Hi, On 2020-04-07 14:51:52 -0400, Robert Haas wrote: > On Tue, Apr 7, 2020 at 2:28 PM Andres Freund <and...@anarazel.de> wrote: > > Does that make some sense? Do you have a better suggestion for a name? > > I think it makes sense. I have two basic problems with the name. The > first is that "on disk" doesn't seem to be a very clear way of > describing what you're actually checking here, and it definitely > doesn't refer to an existing concept which sophisticated hackers can > be expected to understand. The second is that "may" is ambiguous in > English: it can either mean that something is permissible ("Johnny, > you may go to the bathroom") or that we do not have certain knowledge > of it ("Johnny may be in the bathroom"). When it is followed by "be", > it usually has the latter sense, although there are exceptions (e.g. > "She may be discharged from the hospital today if she wishes, but we > recommend that she stay for another day"). Consequently, I found that > use of "may be" in this context wicked confusing.
Well, it *is* only a vague test :). It shouldn't ever have a false positive, but there's plenty chance for false negatives (if wrapped around far enough). > So I suggest a name with "Is" or no verb, rather than one with > "MayBe." And I suggest something else instead of "OnDisk," e.g. > AssertTransactionIdIsInUsableRange() or > TransactionIdIsInAllowableRange() or > AssertTransactionIdWraparoundProtected(). I kind of like that last > one, but YMMV. Make sense - but they all seem to express a bit more certainty than I think the test actually provides. I explicitly did not want (and added a comment to that affect) have something like TransactionIdIsInAllowableRange(), because there never can be a safe use of its return value, as far as I can tell. The "OnDisk" was intended to clarify that the range it verifies is whether it'd be ok for the xid to have been found in a relation. Greetings, Andres Freund