-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add job template to deploy search #95
base: main
Are you sure you want to change the base?
Conversation
This addresses #87. |
I ran the command this job runs manually after enabling elastic search and it all worked as expected, I vote to get this merged. |
If I understand correctly, this will launch an ES re-index after each chart install/upgrade. This is a bad idea as reindexing is an heavy task and has impact to the cluster. It starts by dropping the indexes, then re-create them, so search results are non-existing and/or wrong until it finished. Re-indexes should be launched only when needed (a new index is created, or an existing index has an updated schema), and this is nothing in Mastodon to know if this is the case after an update. I see how this could be useful and will see if we can add a command that launches a re-index only if needed, but for now this should not be merged. |
The intended use case is to deploy once with this enabled and then disable it before future chart deployments. This is a pattern we already use for other one-time jobs. |
I am not sure I understand how this works. How do you disable for future deployments? |
When you want to deploy search, you pass You can also change that setting to |
Is the intention that it runs once, on initial setup, but then not again on future helm upgrades? In which case, wouldn't the Having to change values (especially ones going against the default) to achieve the behaviour feels like an anti-pattern imo. |
The intention was to allow the simple enabling of Elastic Search at the point of an upgrade after an initial install without ES enabled (as discussed in #87) So the question becomes:
|
The intention is [edit: as hardillb noted while I wrote this!] for pre-4.2 installations to run this on upgrade. IIRC a server installed post 4.2 with elasticsearch already working wouldn't need to run this command, but my memory's rusty about that. In either case, this is technically a post-install hook, as well as a post-upgrade hook. Users may leave this feature enabled across multiple upgrades; they will simply have their databases re-indexed which, as @renchap pointed out yesterday, is heavy work to repeat needlessly. We can compare and contrast this with We decide to run it every time because the best way to detect whether the work is necessary is to run the rake command anyway. I would definitely love to know if there's an easy way to detect whether ES needs indexing, but I did not come across one as I worked on this implementation. I believe the one method I tried was happy to declare my initial, empty index was correct and up-to-date 😅 |
7e4a21f
to
fbd87c9
Compare
I've rebased this work onto main. A |
This creates a simple job template to fire off when deploying elasticsearch, e.g. as part of upgrading to 4.2.0 and beyond.