Details
-
Bug
-
Resolution: Fixed
-
Critical
-
7.1.4, 7.1.0, 7.1.1, 7.1.2, 7.2.0, 7.1.3, 7.1.5
-
Untriaged
-
0
-
Unknown
Description
When doing KV range scans or DCP backfills using OSO (using Magma's ByKeyIterator), Magma brings a value into memory and doesn't release it until we invoke Next or destroy the iterator. If KV happens to snooze the backfill for any reason and move onto another backfill (for another vbucket), this memory will continue being held.
This is similar to what we solved in MB-52668, which was for bySeq scans.
The solution for byId scans is similar.
We should also add memory accounting on Magma side for the temporary buffers used during byKey scan.
To repro:
1) Load about 2000 items of size 1MB each into a collection with 1.5GB of quota.
./magma/tools/kvloader/kvloader -numDocs 5000 -numOps 5000 -json -host 172.23.103.51 -workload load -docSize 1000000 -docKeyPrefix a -concurrency 1 -numCollections 1
|
2) Start range scan for all vbuckets. Note the -c 8 flag below is the internal collection id.
for i in $(seq 0 1023); do ./rangescan -h 172.23.103.51 -p 11210 -b default -u Administrator -P password -d --start 'a' --end 'z' --vbucket $i -c 8 --continue-item-limit 1 &; done
|
See the memory_secondary bloat and stay there for 180s, until all range scans get auto-cancelled.
Attachments
For Gerrit Dashboard: MB-57754 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
193559,2 | [BP] MB-57754 magma: Reduce logging for scan by id | neo | magma | Status: MERGED | +2 | +1 |
193560,8 | MB-57754 Release Magma KeyIterator when scan is yielded | neo | kv_engine | Status: MERGED | +2 | +1 |
193627,1 | MB-57754 Release Magma KeyIterator when scan is yielded | master | kv_engine | Status: ABANDONED | 0 | 0 |
196475,1 | Merge commit '3014b040c' into 'couchbase/master' | master | kv_engine | Status: MERGED | +2 | +1 |