-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Ensure SnapshotsInProgress is Immutable #72842
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
Conversation
The user metadata map in `SnapshotsInProgress.Entry` must not be mutable. This change makes all the collections in the snapshot entry instances immutable. Unfortunately, the `EncryptedRepository` relies on the fact that this map is mutable so this commit contains a hack to keep it mutable for now. It does not contain a proper fix because work will shortly be merged removing the need for a mutable map in `SnapshotInfo` as well and fixing the current implementation of `EncryptedRepository` would require adjusting the `Repository` interface. closes elastic#72782
|
Pinging @elastic/es-distributed (Team:Distributed) |
| entry.userMetadata(), | ||
| // TODO: remove this hack making the metadata mutable once | ||
| // https://github.com/elastic/elasticsearch/pull/72776 has been merged | ||
| entry.userMetadata() == null ? null : new HashMap<>(entry.userMetadata()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with the linked test failure was that the map in the entry was mutated while a snapshot status request was iterating over it. We must not have mutable objects in the cluster state so even though this is a horrible hack it at least gives us safe behavior in how our state machines work.
|
Jenkins run elasticsearch-ci/part-2 |
|
Thanks Albert! |
) Backport of the recently introduced snapshot pagination and scalability improvements listed below. Merged as a single backport because the `7.x` and master snapshot status API logic had massively diverged between master and 7.x. With the work in the below PRs, the logic in master and 7.x once again has been aligned very closely again. #72842 #73172 #73199 #73570 #73952 #74236 #74451 (this one is only partly applicable as it was mainly a change to master to align `master` and `7.x` branches)
The user metadata map in
SnapshotsInProgress.Entrymust not be mutable.This change makes all the collections in the snapshot entry instances
immutable. Unfortunately, the
EncryptedRepositoryrelies on the fact thatthis map is mutable so this commit contains a hack to keep it mutable
for now. It does not contain a proper fix because work will shortly be merged
removing the need for a mutable map in
SnapshotInfoas well and fixingthe current implementation of
EncryptedRepositorywould require adjustingthe
Repositoryinterface.non issue since this hasn't had any effect outside of the not yet released encrypted repository.
closes #72782