gfphoenix78 commented on code in PR #1223:
URL: https://github.com/apache/cloudberry/pull/1223#discussion_r2204395822
##########
src/backend/access/gin/ginpostinglist.c:
##########
@@ -335,7 +335,13 @@ ginPostingListDecodeAllSegments(GinPostingList *segment,
int len, int *ndecoded_
}
/* copy the first item */
+ /*
+ * Keep this commented out.
+ * See comments in itemptr_to_uint64().
+ */
+#if 0
Assert(OffsetNumberIsValid(ItemPointerGetOffsetNumber(&segment->first)));
Review Comment:
The maximum numbers of offset in ItemPointData are different on different
representations.
Heap: [1, BLCKSZ / sizeof(ItemIdData)]
AO/CO: [1, 0x8000]
PAX: [1, 0x8000]
The macro OffsetNumberIsValid() uses the number of heap implementation, i.e.
8192 for BLKSIZE=32K.
Another approach is to release the maximum boundary of the offset number.
OffsetNumberIsValid() is also used in other places:
```
gpadmin@hashdata:~/ws/cbdb$ git grep -nw OffsetNumberIsValid
contrib/amcheck/verify_nbtree.c:1865: if
(OffsetNumberIsValid(target_downlinkoffnum))
src/backend/access/gin/ginpostinglist.c:338:
Assert(OffsetNumberIsValid(ItemPointerGetOffsetNumber(&segment->first)));
src/backend/access/gist/gist.c:298: if
(OffsetNumberIsValid(oldoffnum))
src/backend/access/gist/gist.c:542: if
(OffsetNumberIsValid(oldoffnum))
src/backend/access/gist/gist.c:579: if
(OffsetNumberIsValid(oldoffnum))
src/backend/access/gist/gist.c:1179:
Assert(OffsetNumberIsValid(stack->downlinkoffnum));
```
I doubt the call of `OffsetNumberIsValid()` might be incorrect for non-heap
tables.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]