Pseudowires stale data

Hi everyone

I have had an issue for a while now that my pseudowires displayd incorrectly on the Web UI. Initially I thought the issue was with how the data is displayed, but turns out the data in the DB was indeed incorrect.

What I was seeing, was the following:

So at one point there must have been a discovery that lead to the following data entries in the DB:

With the help from another community member I updated the DB to see if the web ui does indeed display correctly. The commands I ran was the following:

UPDATE pseudowires SET peer_device_id=53 WHERE pseudowire_id=1;
UPDATE pseudowires SET peer_device_id=51 WHERE pseudowire_id=2;

That lead to:

So this got me thinking. I then deleted all of the data from the pseudowires table completely, and rediscovered and repolled all of the devices, and all of a sudden I got the desired result.

The environment where I fixed everything, is a clone from a vm that is still displaying it wrong. So my question is this:

Why doesn’t a rediscovery and polling automatically update the data in the DB? Why is a complete delete and rediscovery + polling needed to get the data to update and consequently display correctly?