feat(dreyfus): change how indexer processes are linked to Clouseau#5929
Draft
pgj wants to merge 2 commits intoapache:mainfrom
Draft
feat(dreyfus): change how indexer processes are linked to Clouseau#5929pgj wants to merge 2 commits intoapache:mainfrom
dreyfus): change how indexer processes are linked to Clouseau#5929pgj wants to merge 2 commits intoapache:mainfrom
Conversation
Dreyfus and Clouseau maintain a shared LRU cache of actively managed indexes, which may fall apart if the rate of eviction is getting too high. Such situations may happen when there are too many indexes to manage in a relatively short period of time so that Clouseau is forced to switch between them very rapidly and therefore it becomes a subject of thrashing. Thrashing may lead to process termination messages of indexers being closed (by the unexpected eviction) not necessarily processed in time and the subsequent search requests on the Dreyfus side will start failing via observing `noproc` errors due to the backing indexer is gone. This immediately translates to an HTTP 500 errors, which is visible to the user. Maintaining a shared state joined by Erlang process identifiers as keys is an inherently fragile idea due to their volatile nature when one of the sides is emulated in Java. That is why we shall find a more stable key, the path of the index file which is less prone to change. Indexes would be still managed by dedicated indexers processes as before, but the communication to them would happen solely through a third-party process on the Clouseau side. This process would then keep track of the states and availability of each indexer and handle the message forwarding for them properly. The change is implemented in a backward compatible way by putting the new-style communication method behind a toggle. This would make it possible for Dreyfus to work with Clouseau instances that have not been upgraded to support this protocol.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Dreyfus and Clouseau maintain a shared LRU cache of actively managed indexes, which may fall apart if the rate of eviction is getting too high.
Such situations may happen when there are too many indexes to manage in a relatively short period of time so that Clouseau is forced to switch between them very rapidly and therefore it becomes a subject of thrashing. Thrashing may lead to process termination messages of indexers being closed (by the unexpected eviction) not necessarily processed in time and the subsequent search requests on the Dreyfus side will start failing via observing
noprocerrors due to the backing indexer is gone. This immediately translates to an HTTP 500 errors, which is visible to the user.Maintaining a shared state joined by Erlang process identifiers as keys is an inherently fragile idea due to their volatile nature when one of the sides is emulated in Java. That is why we shall find a more stable key, the path of the index file which is less prone to change.
Indexes would be still managed by dedicated indexers processes as before, but the communication to them would happen solely through a third-party process on the Clouseau side. This process would then keep track of the states and availability of each indexer and handle the message forwarding for them properly.
The change is implemented in a backward compatible way by putting the new-style communication method behind a toggle. This would make it possible for Dreyfus to work with Clouseau instances that have not been upgraded to support this protocol.
Testing recommendations
The existing set of tests should be able to cover this change. More specifically, if one runs the standard Search tests with Clouseau configuration, everything should just keep working as before.
TODO: Talk about reconfiguring Dreyfus to start utilizing the forwarding interface. Albeit the involved tests suites should be about the same. There shall be no semantic differences.
Related Issues or Pull Requests
This change would be served best with cloudant-labs/clouseau#149.
Checklist
rel/overlay/etc/default.ini