-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
The interval tree is not complete implementation based on red-black tree #10877
Comments
Delete Node 11, the interval tree code will not execute |
Thanks for pointing this out. Can you write a test case and a fix? |
@xiang90 YES,I will make a pull request for the interval tree |
Please see my pull request code, can not pass the case of TestCtlV3AuthAndWatch |
I find all use interval tree codes, some codes use Union function not use pointer, I change them all, but no use. |
Please take a look the pull request, thx |
Described in etcd-io#10877. "black-height" property: Every path from a node to any descendant leaf node must have the same number of black nodes. Expected After deleting 11 (requires rebalancing): [510,511] / \ ---------- -------------------------- / \ [383,384] [830,831] / \ / \ / \ / \ [261,262](red) [410,411] [647,648] [899,900](red) / \ \ / \ / \ \ / \ [82,83] [292,293] [815,816](red) [888,889] [972,973] \ / \ / [238,239](red) [953,954](red) Got After deleting 11 (requires rebalancing): [510,511] / \ ---------- -------------------------- / \ [82,83] [830,831] \ / \ \ / \ [383,384] [647,648] [899,900] / \ \ / \ / \ \ / \ [261,262] [410,411] [815,816] [888,889] [972,973] / \ / / \ / [238,239] [292,293] [953,954] This violates "black-height" property. Signed-off-by: Gyuho Lee <[email protected]>
Described in etcd-io#10877. "black-height" property: Every path from a node to any descendant leaf node must have the same number of black nodes. Expected After deleting 11 (requires rebalancing): [510,511] / \ ---------- -------------------------- / \ [383,384] [830,831] / \ / \ / \ / \ [261,262](red) [410,411] [647,648] [899,900](red) / \ \ / \ / \ \ / \ [82,83] [292,293] [815,816](red) [888,889] [972,973] \ / \ / [238,239](red) [953,954](red) Got After deleting 11 (requires rebalancing): [510,511] / \ ---------- -------------------------- / \ [82,83] [830,831] \ / \ \ / \ [383,384] [647,648] [899,900] / \ \ / \ / \ \ / \ [261,262] [410,411] [815,816] [888,889] [972,973] / \ / / \ / [238,239] [292,293] [953,954] This violates "black-height" property. Signed-off-by: Gyuho Lee <[email protected]>
Described in etcd-io#10877. "black-height" property: Every path from a node to any descendant leaf node must have the same number of black nodes. Expected After deleting 11 (requires rebalancing): [510,511] / \ ---------- -------------------------- / \ [383,384] [830,831] / \ / \ / \ / \ [261,262](red) [410,411] [647,648] [899,900](red) / \ \ / \ / \ \ / \ [82,83] [292,293] [815,816](red) [888,889] [972,973] \ / \ / [238,239](red) [953,954](red) Got After deleting 11 (requires rebalancing): [510,511] / \ ---------- -------------------------- / \ [82,83] [830,831] \ / \ \ / \ [383,384] [647,648] [899,900] / \ \ / \ / \ \ / \ [261,262] [410,411] [815,816] [888,889] [972,973] / \ / / \ / [238,239] [292,293] [953,954] This violates "black-height" property. Signed-off-by: Gyuho Lee <[email protected]>
Described in #10877. "black-height" property: Every path from a node to any descendant leaf node must have the same number of black nodes. Expected After deleting 11 (requires rebalancing): [510,511] / \ ---------- -------------------------- / \ [383,384] [830,831] / \ / \ / \ / \ [261,262](red) [410,411] [647,648] [899,900](red) / \ \ / \ / \ \ / \ [82,83] [292,293] [815,816](red) [888,889] [972,973] \ / \ / [238,239](red) [953,954](red) Got After deleting 11 (requires rebalancing): [510,511] / \ ---------- -------------------------- / \ [82,83] [830,831] \ / \ \ / \ [383,384] [647,648] [899,900] / \ \ / \ / \ \ / \ [261,262] [410,411] [815,816] [888,889] [972,973] / \ / / \ / [238,239] [292,293] [953,954] This violates "black-height" property. Signed-off-by: Gyuho Lee <[email protected]>
Described in etcd-io#10877. "black-height" property: Every path from a node to any descendant leaf node must have the same number of black nodes. Expected After deleting 11 (requires rebalancing): [510,511] / \ ---------- -------------------------- / \ [383,384] [830,831] / \ / \ / \ / \ [261,262](red) [410,411] [647,648] [899,900](red) / \ \ / \ / \ \ / \ [82,83] [292,293] [815,816](red) [888,889] [972,973] \ / \ / [238,239](red) [953,954](red) Got After deleting 11 (requires rebalancing): [510,511] / \ ---------- -------------------------- / \ [82,83] [830,831] \ / \ \ / \ [383,384] [647,648] [899,900] / \ \ / \ / \ \ / \ [261,262] [410,411] [815,816] [888,889] [972,973] / \ / / \ / [238,239] [292,293] [953,954] This violates "black-height" property. Signed-off-by: Gyuho Lee <[email protected]>
Because of Interval Tree of Etcd use golang nil as red-black tree "NIL", delete someone node The Tree will not according with Property 5.
For example:
Delete Node 514, then delete node 11 should be:
The text was updated successfully, but these errors were encountered: