The data update functionality is broken for existing indexes that are opened in the current session. (regression from last fix)
Steps of reproduction.
- Create a beer sample default index and wait for indexing to complete.
- Shutdown cluster run.
- Start the cluster again.
- Goto bucket and edit some text and then search the new text in the index.
- Confirm whether you get those new updates in the search results.
Root cause => the original fix here made the analysis workers to reset at this point - https://github.com/couchbase/cbft/blob/5cb62de5ab305604a141258c3dbb3b7840629388/cmd/cbft/init_bleve.go#L88
But by the time this reset happens, many of the existing scorch indexes would have already opened with the older workers from here(https://github.com/couchbase/cbft/blob/3fc4af32e1426d8ce07af03c44cb72b3f461b509/cmd/cbft/main.go#L376) which are in a closed state now due to the reset that happened above.
So, no further indexing/mutations would be handled in those opened/old indexes since their analysis queue are closed. And they never get linked to the new refreshed/reset analysis queue.
Girish Benakappa, It is surprising that this regression got escaped in the automated weekly tests.
We need to cover such cases in our automated tests so that these are never missed in the future.