On Fri, Oct 1, 2021 at 6:30 AM Masahiko Sawada <sawada.m...@gmail.com> wrote: > > On Fri, Oct 1, 2021 at 5:05 AM Peter Eisentraut > <peter.eisentr...@enterprisedb.com> wrote: > > > > Also, what happens when you forget to reset the xid after it has passed? > > Will it get skipped again after wraparound? > > Yes. >
Aren't we resetting the skip_xid once we skip that transaction in stop_skipping_changes()? If so, it shouldn't be possible to skip it again after the wraparound. Am I missing something? Now, if the user has wrongly set some XID which we can't skip as that is already in past or something like that then I think it is the user's problem and that's why it can be done only by super users. I think we have even thought of protecting that via cross-checking with the information in view but as the view data is lossy, we can't rely on that. I think users can even set some valid XID that never has any error and we will still skip it which is what can be done today also by pg_replication_origin_advance(). I am not sure if we can do much about such scenarios except to carefully document them. -- With Regards, Amit Kapila.