-
Notifications
You must be signed in to change notification settings - Fork 197
Disable offsetnumber assertion in ginPostingListDecodeAllSegments() #1223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Copilot warns that the problem can also occur on line 112 of the same file and in B-tree, GiST, SP-GiST, Hash, and BRIN indexes. |
I currently don’t use Copilot, appreciate it if you could help verify whether the issue is reproducible. If you confirm it’s a problem, please feel free to:
Happy to collaborate on resolving this if it’s indeed an issue! |
5e8db67 to
8e16a66
Compare
|
What's the offset value when assert failure happens? 0, or exceed the maximum number of MaxOffsetNumber? |
0c9911f to
ed13150
Compare
|
Add a FIXME for potential failures in other files. see ed13150 |
Fix issue: apache#1222 As comments in itemptr_to_uint64: Greenplum allow 16 bits for the offsetnumber, which turns the below upstream assertion into an always-true comparison which generates a compiler warning; thus we need to keep this commented out. For sql in issue 1222, we will get assert failure as: DETAIL: FailedAssertion("!(((_Bool) ((( ((void) ((_Bool) (! (!(((_Bool) (((const void*)(&segment->first) != ((void *)0)) && ((&segment->first)->ip_posid != 0))))) || (ExceptionalCondition("!(((_Bool) (((const void*)(&segment->first) != ((void *)0)) && ((&segment->first)->ip_posid != 0))))", ("FailedAssertion"), "ginpostinglist.c", 338), 0)))), ( (&segment->first)->ip_posid ) ) != ((OffsetNumber) 0)) && (( ((void) ((_Bool) (! (!(((_Bool) (((const void*)(&segment->first) != ((void *)0)) && ((&segment->first)->ip_posid != 0))))) || (ExceptionalCondition("!(((_Bool) (((const void*)(&segment->first) != ((void *)0)) && ((&segment->first)->ip_posid != 0))))", ("FailedAssertion"), "ginpostinglist.c", 338), 0)))), ( (&segment->first)->ip_posid ) ) <= ((OffsetNumber) (32768 / sizeof(ItemIdData)))))))", File: "ginpostinglist.c", Line: 338) Reported-by: assam258-5892 [email protected] Reproduced-by: Zhang Mingli [email protected] Authored-by: Zhang Mingli [email protected]
Fix issue: #1222
As comments in itemptr_to_uint64:
Greenplum allow 16 bits for the offsetnumber, which turns the below upstream assertion into an always-true comparison which generates a compiler warning; thus we need to keep this commented out.
For sql in issue 1222, we will get assert failure as:
DETAIL: FailedAssertion("!(((_Bool) ((( ((void) ((_Bool) (! (!(((_Bool) (((const void*)(&segment->first) != ((void )0)) && ((&segment->first)->ip_posid != 0))))) ||
(ExceptionalCondition("!(((_Bool) (((const void)(&segment->first) != ((void )0)) && ((&segment->first)->ip_posid != 0))))", ("FailedAssertion"), "ginpostinglist.c", 338), 0)))), ( (&segment->first)->ip_posid ) ) != ((OffsetNumber) 0)) && (( ((void) ((_Bool) (! (!(((_Bool) (((const void)(&segment->first) != ((void )0)) && ((&segment->first)->ip_posid != 0))))) ||
(ExceptionalCondition("!(((_Bool) (((const void)(&segment->first) != ((void *)0)) && ((&segment->first)->ip_posid != 0))))", ("FailedAssertion"), "ginpostinglist.c", 338), 0)))), ( (&segment->first)->ip_posid ) ) <= ((OffsetNumber) (32768 / sizeof(ItemIdData)))))))", File: "ginpostinglist.c", Line: 338)
Reported-by: assam258-5892 [email protected]
Reproduced-by: Zhang Mingli [email protected]
Authored-by: Zhang Mingli [email protected]
Fixes #ISSUE_Number
What does this PR do?
Type of Change
Breaking Changes
Test Plan
make installcheckmake -C src/test installcheck-cbdb-parallelImpact
Performance:
User-facing changes:
Dependencies:
Checklist
Additional Context
CI Skip Instructions