On Mon, Oct 30, 2023 at 7:13 PM Robert Haas <robertmh...@gmail.com> wrote: > > On Sat, Oct 28, 2023 at 6:15 AM Amit Kapila <amit.kapil...@gmail.com> wrote: > > > Hmm. So my question is: do we need the cleanup lock on the write > > > buffer even if there are no tuples, and even if primary bucket and the > > > write bucket are the same? > > > > Yes, we need it to exclude any concurrent in-progress scans that could > > return incorrect tuples during bucket squeeze operation. > > Amit, thanks for weighing in, but I'm not convinced. I thought we only > ever used a cleanup lock on the main bucket page to guard against > concurrent scans. >
My understanding is the same. It is possible that my wording is not clear. Let me try to clarify again, Michael asked: "do we need the cleanup lock on the write buffer even if there are no tuples, and even if primary bucket and the write bucket are the same?" My reading of his question was do we need a cleanup lock even if the primary bucket and write bucket are the same which means the write bucket will be the first page in the chain and we need a cleanup lock on it. I think the second condition (no tuples) seems irrelevant here as whether that is true or false we need a cleanup lock. > Here you seem to be saying that we need a cleanup > lock on some page that may be an overflow page somewhere in the middle > of the chain, and that doesn't seem right to me. > Sorry, I don't intend to say this. -- With Regards, Amit Kapila.