You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently multiple calls to scheduleCompaction result
in new tasks being created and scheduled, they will all
eventually run and compact the vbucket many times.
This change aims to improve this by trying to maintain just one
CompactTask per vbucket. The aim is that if multiple
schedculeCompaction calls occur
* The first call creates a task with the given CompactionConfig
* Subsequent calls update the task with the most recent
CompactionConfig
The task itself is changed so that there is a window/scope inside
the run function where it copies the configuration and starts
compacting. Once this has happened the compaction will complete,
but any schedule calls happening whilst compaction is running will
update the tasks config and set a flag so that when the task
completes it reschedules ready to run again with the new config.
The main purpose of this change is to improve what happens when a
scope is dropped. We have seen from logs that a scope drop may
trigger many compactions as each collection that is dropped
calls scheduleCompaction. As part of this improvement the
scheduleCompaction function now takes a delay parameter which
when 0 means no-delay (schedule now) otherwise schedule but run
in 'delay' seconds. The collections use of scheduleCompaction sets
a short delay and once all collection drops have been flushed
one compaction will run a short time later.
Change-Id: I998b5fe6833b2b7e1681cac64933d58da7b9560f
Reviewed-on: http://review.couchbase.org/c/kv_engine/+/140364
Tested-by: Build Bot <[email protected]>
Reviewed-by: James Harrison <[email protected]>
0 commit comments