Gyuho Lee
46f04b3c15
pkg/adt: add "IntervalTree.Delete" failure case
...
Described in https://github.com/etcd-io/etcd/issues/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 <leegyuho@amazon.com>
2019-07-31 10:05:32 -07:00