Antonin Houska <ah@cybertec.at> wrote:
> shihao zhong <zhong950419@gmail.com> wrote:
>
> > 2.
> > Looks like some rows are lost when the table grows/gap fill.
> >
> > heapScan->rs_nblocks is fixed when the scan starts. At a range boundary,
> > changes to blocks at or beyond rs_nblocks are not in [range_start, range_end),
> > so they are skipped. The next snapshot can see those tuples, but the scan never
> > reaches those blocks.
> >
> > The attached extend.spec has 5 blocks. It uses
> > repack_snapshot_after = 2, pauses at the first boundary, and inserts 100
> > rows. 70 of them go to blocks 5 to 7 and are missing after REPACK.
>
> Interestiong. I think we need to get the new rows from new blocks each time we
> process the concurrent changes.
I could spend a little while on this item. Attached is what fixes your
extend.spec.text.
--
Antonin Houska
Web: https://www.cybertec-postgresql.com