Commit 34ac008
committed
Fix run_on_first_node scanner features
`run_on_first_node` feature is a running mode for plugins which are only
interested in design documents, and may want to avoid fetching clustered design
docs on all nodes.
However that feature didn't work since it clashed with a premature optimization
in plugin's `scan_db/2` function, which avoided scanning the db if no shards
were scheduled to be scanned on the first node. For example, with a 3 node
cluster and a q=2 db, it was possible to have both of its shards scheduled to
be scanned on db2 and db3, respectively, while the plugin was running on db1
only. In that case the plugin would have skipped calling the main part of
`scan_db` which does ddoc processing.
The fix is to remove the premature optimization and load the ddoc even if no
shards are scheduled to be scanned on that node since we may be dealing with a
plugin which is only interested in design documents.1 parent b5dfe12 commit 34ac008
1 file changed
+1
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | | - | |
319 | | - | |
320 | | - | |
| 318 | + | |
321 | 319 | | |
322 | 320 | | |
323 | 321 | | |
| |||
0 commit comments