On Thu, Aug 4, 2022 at 12:59 PM Andres Freund <and...@anarazel.de> wrote: > Why you think it's better to not have the test than to have a very limited > amount of fuzziness (by using the next xid as an upper limit). What's the bug > that will reliably pass the nextxid fuzzy comparison, but not an exact > comparison?
I don't know. I mean, I guess one possibility is that the nextXid value could be wrong too, because I doubt we have any separate test that would catch that. But more generally, I don't have a lot of confidence in fuzzy tests. It's too easy for things to look like they're working when they really aren't. Let's say that the value in the old cluster was 100 and the nextXid in the new cluster is 1000. Well, it's not like every value between 100 and 1000 is OK. The overwhelming majority of those values could never be produced, neither from the old cluster nor from any subsequent vacuum. Given that the old cluster is suffering no new write transactions, there's probably exactly two values that are legal: one being the value from the old cluster, which we know, and the other being whatever a vacuum of that table would produce, which we don't know, although we do know that it's somewhere in that range. Let's flip the question on its head: why should some hypothetical future bug that we have in this area produce a value outside that range? If it's a failure to set the value at all, or if it generates a value at random, we'd likely still catch it. And those are pretty likely, so maybe the value of such a test is not zero. On the other hand, subtle breakage might be more likely to survive developer testing than complete breakage. -- Robert Haas EDB: http://www.enterprisedb.com