Jeff Janes <jeff.ja...@gmail.com> writes:
> But, another perhaps stupid question, why do we care what the value of
> nextOid was at the start of the last successfully completed
The intended use of that field is to restore nextOid before replaying
WAL. So it should correspond to the value at checkpoint start. I think
what the code is doing now during replay is probably just brain fade :-(
> Wouldn't it make more sense to populate that part of the
> record at the end, not the start, of the checkpoint?
The idea is that we should initialize the OID counter to something
approximately right before we start replay, so that replay of OID-
counter-advance records behaves sensibly.
> But, to round this out, all of this is formally only a hint on where
> to start OIDs so as to avoid performance problems as you busy-loop
> looking for an unused OID. The real correctness bug is in the
> hint-bit problem you discuss elsewhere that turns collisions into
> corruption, and this bug just makes that other one reachable?
Right, the theory is that being slightly off shouldn't matter.
If that's wrong, we would have race-condition problems with either
intended timing of sampling the OID counter.
regards, tom lane
Sent via pgsql-hackers mailing list (email@example.com)
To make changes to your subscription: