Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add aliased_index contextmanager for reindexing
This is the final piece of the automatic reindexing puzzle - with this we should be able to basically-atomically reindex data via a cronjob. This is accomplished by indexing a new version of the data into an index named like votizen_verifier_20151010010203 and then once the import finishes, moving the index alias `votizen_verifier` to point to that index. This commit adds a contextmanager which handles the creation and movement of this alias. If there is an unhandled exception during the upgrade, the index alias remains unmoved. Also, this does not clean up any old indexes. That much should be manual, IMHO, at least until we are pretty confident in this process. Change-Id: I31b1465b8d1a908a54c20e055f5876a0de432dad Reviewed-on: https://code.brigade.com/6761 Tested-by: Leeroy Jenkins <[email protected]> Reviewed-by: Shane da Silva <[email protected]>
- Loading branch information