Mark read-only flush and verify#119743
Conversation
When marking read-only now flush and mark index as verified. Use this in the deprecation check.
|
Hi @henningandersen, I've created a changelog YAML for you. |
|
One drive-by comment here — we re-use language around calling an index "read-only" and the |
Yes, both are covered, see this line. There are likely a few corners more to cover in this PR like if both blocks are applied and one is removed, we may want to leave the verified flag intact. |
|
Do you think we'd also be able to do a "verified" block on a closed index? I.e., adding the verification flag to an index that is currently closed. |
|
A closed index is already flushed and verified, it has its own verified flag at least. I would prefer to just allow closed n-2 indices to be upgraded, though the user will then have to mark them read only before opening on the new version. |
Plus fix various issues.
tlrx
left a comment
There was a problem hiding this comment.
Looks good, I'm waiting for tests to be added before final approval
server/src/main/java/org/elasticsearch/cluster/metadata/MetadataIndexStateService.java
Outdated
Show resolved
Hide resolved
|
Pinging @elastic/es-distributed-indexing (Team:Distributed Indexing) |
tlrx
left a comment
There was a problem hiding this comment.
LGTM, thanks for the additionnal test.
💔 Backport failed
You can use sqren/backport to manually backport by running |
Now the Add Index Block API automatically synchronizes the translog, flushes the shard and sets the verified setting, we can use it in the N-2 upgrade tests instead of explicit calls. Relates elastic#119743 Relates elastic#120522
When marking read-only now flush and mark index as verified guaranteeing that we can upgrade safely to next version with N-1 indices (becoming N-2). Use this in the deprecation check.
This change contains follows ups now the Add Index Block API change is merged. The index setting `index.verified_read_only`can now be `PrivateIndex` and not `Dynamic` anymore. Regular indices in version N-2 can recover if they have the `index.block.read_only` too. And finally, upgrade tests can use the Add Index Block API instead of manually flushing and adding blocks explicitly. This change requires #120537 for `8.x` (tests will fail until it is merged). Relates #119743 Relates #120522
| @@ -0,0 +1,5 @@ | |||
| pr: 119743 | |||
| summary: POC mark read-only | |||
There was a problem hiding this comment.
@henningandersen can we open another PR to make this better for user-facing changelogs?
When marking read-only now flush and mark index as verified. Use this in the deprecation check.