summaryrefslogtreecommitdiff
path: root/src/smoosh
Commit message (Collapse)AuthorAgeFilesLines
* fix race condition (#3150)Tony Sun2020-09-141-1/+1
| | | | | | | This fixes a94e693f32672e4613bce0d80d0b9660f85275ea because a race condition exisited where the 'DOWN' message could be received before the compactor pid is spawned. Adding a synchronous call to get the compactor pid guarantees that the couch_db_updater process handling of finish_compaction has occurred.
* add remonitor code to DOWN message (#3144)Tony Sun2020-09-101-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | Smoosh monitors the compactor pid to determine when the compaction jobs finishes, and uses this for its idea of concurrency. However, this isn't accurate in the case where the compaction job has to re-spawn to catch up on intervening changes since the same logical compaction job continues with another pid and smoosh is not aware. In such cases, a smoosh channel with concurrency one can start arbitrarily many additional database compaction jobs. To solve this problem, we added a check to see if a compaction PID exists for a db in `start_compact`. But wee need to add another check because this check is only for shard that comes off the queue. So the following can still occur: 1. Enqueue a bunch of stuff into channel with concurrency 1 2. Begin highest priority job, Shard1, in channel 3. Compaction finishes, discovers compaction file is behind main file 4. Smoosh-monitored PID for Shard1 exits, a new one starts to finish the job 5. Smoosh receives the 'DOWN' message, begins the next highest priority job, Shard2 6. Channel concurrency is now 2, not 1 This change adds another check into the 'DOWN' message so that it checks for that specific shard. If the compaction PID exists then it means a new process was spawned and we just monitor that one and add it back to the queue. The length of the queue does not change and therefore we won’t spawn new compaction jobs.
* Address flaky test failure on t_invalid_view/1jiangph2020-01-091-3/+6
| | | | | - Start couch_log to make sure that couch_log_server proc exists and write log instead of getting noproc error during test
* Speedup eunit: smoosh_serverPaul J. Davis2019-12-251-18/+27
|
* Suppress exunit compiler warningJay Doane2019-12-131-2/+0
| | | | | | | This patch suppresses this warning when `make exunit` is run: warning: unused alias Setup src/smoosh/test/exunit/scheduling_window_test.exs:4
* Switch to UTCJay Doane2019-12-131-1/+1
| | | | The tests assume UTC, and often fail when run in non-GMT time zones.
* Add 'src/smoosh/' from commit '78eba8444c0ba50994c7b686251f3a7c21dc92ce'Adam Kocoloski2019-11-2212-0/+1861
git-subtree-dir: src/smoosh git-subtree-mainline: 0155bd884bd8c455cc4057811cf67035b04c427f git-subtree-split: 78eba8444c0ba50994c7b686251f3a7c21dc92ce