diff options
author | Melanie Plageman | 2025-04-03 22:22:37 +0000 |
---|---|---|
committer | Melanie Plageman | 2025-04-03 22:22:37 +0000 |
commit | 54a3615f15b9b2e1433bc47cfb150317885d7c1f (patch) | |
tree | d6d75e266f08e0ef754be90364076e5d7de62e5e | |
parent | dbd437e670b88ca67f6b2477e853412a0e82a8cc (diff) |
Remove misleading read stream asserts in a few users
Several read stream users asserted that the read stream was exhausted
after looping on that very condition. It was pointed out in an a
review of an as-of-yet uncommitted read stream user [1] that this was
confusing and could lead the reader to think there was a possibility of
some kind of race condition. Remove these asserts.
[1] https://postgr.es/m/F9ACE8D0-B807-4A17-B6BD-87EF0717983D%40yesql.se
-rw-r--r-- | contrib/amcheck/verify_heapam.c | 2 | ||||
-rw-r--r-- | src/backend/access/gist/gistvacuum.c | 2 | ||||
-rw-r--r-- | src/backend/access/nbtree/nbtree.c | 2 | ||||
-rw-r--r-- | src/backend/access/spgist/spgvacuum.c | 2 |
4 files changed, 0 insertions, 8 deletions
diff --git a/contrib/amcheck/verify_heapam.c b/contrib/amcheck/verify_heapam.c index 1970fc8620a..2152d8ee577 100644 --- a/contrib/amcheck/verify_heapam.c +++ b/contrib/amcheck/verify_heapam.c @@ -853,8 +853,6 @@ verify_heapam(PG_FUNCTION_ARGS) break; } - /* Ensure that the stream is completely read */ - Assert(read_stream_next_buffer(stream, NULL) == InvalidBuffer); read_stream_end(stream); if (vmbuffer != InvalidBuffer) diff --git a/src/backend/access/gist/gistvacuum.c b/src/backend/access/gist/gistvacuum.c index ce9d78d78d6..6a359c98c60 100644 --- a/src/backend/access/gist/gistvacuum.c +++ b/src/backend/access/gist/gistvacuum.c @@ -254,8 +254,6 @@ gistvacuumscan(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, gistvacuumpage(&vstate, buf); } - Assert(read_stream_next_buffer(stream, NULL) == InvalidBuffer); - /* * We have to reset the read stream to use it again. After returning * InvalidBuffer, the read stream API won't invoke our callback again diff --git a/src/backend/access/nbtree/nbtree.c b/src/backend/access/nbtree/nbtree.c index 4a0bf069f99..a99667eb2bd 100644 --- a/src/backend/access/nbtree/nbtree.c +++ b/src/backend/access/nbtree/nbtree.c @@ -1117,8 +1117,6 @@ btvacuumscan(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, current_block); } - Assert(read_stream_next_buffer(stream, NULL) == InvalidBuffer); - /* * We have to reset the read stream to use it again. After returning * InvalidBuffer, the read stream API won't invoke our callback again diff --git a/src/backend/access/spgist/spgvacuum.c b/src/backend/access/spgist/spgvacuum.c index b3df2d89074..81171f35451 100644 --- a/src/backend/access/spgist/spgvacuum.c +++ b/src/backend/access/spgist/spgvacuum.c @@ -879,8 +879,6 @@ spgvacuumscan(spgBulkDeleteState *bds) spgprocesspending(bds); } - Assert(read_stream_next_buffer(stream, NULL) == InvalidBuffer); - /* * We have to reset the read stream to use it again. After returning * InvalidBuffer, the read stream API won't invoke our callback again |