Details
-
Bug
-
Resolution: Fixed
-
Critical
-
None
-
Untriaged
-
1
-
No
Description
Operations like PersistAll operate with a concurrency parameter which is used to split skiplist into range partitions. For concurrency=n, first n wctx are allocated in an array and then n range partitions are generated using GetRangeSplitItems. If GetRangeSplitItems results in >n range partitions, we can run into index out of range panic.
=== RUN TestShardRecoveryRecoveryLogCorruption
|
----------- running TestShardRecoveryRecoveryLogCorruption
|
....
|
Shard shards/shard1(1) : instance test.default.TestShardRecoveryRecoveryLogCorruption_19 started
|
Loading data...
|
Plasma: Plasma.monitor: Starting monitorpanic: runtime error: index out of range [1] with length 1goroutine 491912 [running]:
|
panic(0x7e9a40, 0xc000e761f8)
|
/home/buildbot/.cbdepscache/exploded/x86_64/go-1.16.5/go/src/runtime/panic.go:1065 +0x565 fp=0xc000065e18 sp=0xc000065d50 pc=0x43b3e5
|
runtime.goPanicIndex(0x1, 0x1)
|
/home/buildbot/.cbdepscache/exploded/x86_64/go-1.16.5/go/src/runtime/panic.go:88 +0xa5 fp=0xc000065e60 sp=0xc000065e18 pc=0x438585
|
github.com/couchbase/plasma.(*Plasma).PersistAll2.func1(0x7f412c8efcb0, 0x1, 0xc000212000, 0xffffffffffffffff, 0xc000a30f28, 0x47d70b)
|
GetRangeSplitItems can return >n items if more skiplist nodes are added to the chosen level while GetRangeSplitItems is still running. In nitro this is handled correctly. In plasma, this must be fixed by making sure callback passed to PageVisitor can handle the extra range partitions - by allocating wctx on the fly if more range partitions are returned.
Attachments
For Gerrit Dashboard: MB-51338 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
171925,1 | MB-51338: Avoid getting more partitions than requested in GetRangePartitions | unstable | plasma | Status: MERGED | +2 | +1 |