enhance smoosh to cleanup search indexes when ddocs change
Overview
automate cleaning up search indexes (clouseau and nouveau) when design documents are updated.
Testing recommendations
TBD
Related Issues or Pull Requests
N/A
Checklist
- [x] Code is written and works correctly
- [ ] Changes are covered by tests
- [ ] Any new configurable parameters are documented in
rel/overlay/etc/default.ini - [ ] Documentation changes were made in the
src/docsfolder - [ ] Documentation changes were backported (separated PR) to affected branches
I need to add tests to this and intend to, just wanted to show the work so far.
Overall this looks like what we would want to happen: as soon as we update the ddoc we can clean up the old index data.
With the ddoc trigger one thing I was worried about is the case when we get a ddoc_updated on one node first, and not the others yet: we make a clustered call to get all the ddocs and get the signatures, what if that's stale since it happens concurrently with the ddoc_updated, would there be a chance we'd remove the new index file we just created? Maybe it's a low enough chance of happening that it's not a problem as long as it eventually sorts itself out. (We delete the newly building index file but then it gets rebuilt quickly anyway).
that's an excellent point, we must ensure that cannot happen, at least not with any higher probability than the existing cleanup code for mrview.
that's an excellent point, we must ensure that cannot happen, at least not with any higher probability than the existing cleanup code for mrview.
We could punt changing the trigger mechanism for later and just opt to run the nouveau and dreyfus cleanup as is, alongside mrview indexes?