Fix index reincarnation routing bug#6217
Merged
nadav-govari merged 5 commits intomainfrom Mar 25, 2026
Merged
Conversation
a7aab7c to
ba3d58a
Compare
guilload
reviewed
Mar 25, 2026
| }; | ||
| let value = serde_json::to_string(&capacity) | ||
| .expect("`IngesterCapacityScore` should be JSON serializable"); | ||
| self.cluster.set_self_key_value(key, value).await; |
Member
There was a problem hiding this comment.
One cycle is too short. Let's just use set_self_key_value_delete_after_ttl and get rid of the pending_removal logic.
9cfdaa0 to
e20f914
Compare
guilload
approved these changes
Mar 25, 2026
Member
guilload
left a comment
There was a problem hiding this comment.
Logic is sound. Code is inelegant. The old routing table code also had useful comments:
match self.index_uid.cmp(index_uid) {
// If we receive an update for a new incarnation of the index, then we clear the entry
// and insert all the shards.
std::cmp::Ordering::Less => {
self.index_uid = index_uid.clone();
self.clear_shards();
}
// If we receive an update for a previous incarnation of the index, then we ignore it.
std::cmp::Ordering::Greater => {
return;
}
std::cmp::Ordering::Equal => {}
};
quickwit/quickwit-ingest/src/ingest_v2/broadcast/capacity_score.rs
Outdated
Show resolved
Hide resolved
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.
Description
Node based routing introduced a bug - there was no index_uid tracking, and a new index_uid didnt clear old routing entries. As a result, deleting an index and recreating it with the same name, which is normally fine, would result in unavailability.
This fixes that by:
Added a unit test and an integ test