-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Etcd corruption detection triggers during in-place cluster recovery #15548
Comments
This isn't correct to me. During a disaster recovery,
The So I don't think this is a bug. |
As mentioned before etcd already supports in-place restore. Problem is only when data corruption detection is enabled. Restoring member changes it's cluster id specifically to avoid restored members forming a quorum with non-restored ones. |
I don't think etcd supports such member restart from db snapshot with configuration Taking look at the raft http code path, it rejects any raft communication in
etcd/server/etcdserver/api/rafthttp/http.go Lines 499 to 512 in e522ce0
Even though somehow you recover from the db snapshot with configuration |
Note that restoring cluster from a snapshot is actually creating/starting a new cluster instead of "in-place restoring a cluster". |
If I understand correctly we have 2 orthogonal discussions here:
I agree it carries risks so from operational perspective it's safer to turn off one cluster and create a new one after. But even if we assume it carries risks, the etcd should put a bar high on not doing anything 'stupid' in such a situation. So we can think about this as a test-case for isolation (2).
@ahrtr @chaochn47 I assume you agree that checking cluster_id for cross-node communication is a good thing to have, |
Thanks @ptabor for the clarification. It makes more sense to me now. I suggest the issue title to be renamed to align with the summary. I slim through the etcdhttp/peer.go should have such protection cluster_id the same for peer communication. Thanks @serathius for reporting. |
It is not about good/bad practice. It isn't supported by etcd at all. Of course, I agree we should add some protection for such case.
Agreed. Please anyone feel free to deliver a PR for this. thx |
I think i can try to do this. @ahrtr |
@lbllol365 assigned to you, thx |
Is this issue open? |
Hey @vianamjr - This was assigned out in late April and I don't recall seeing any updates since so I think you would be welcome to start working on it. Perhaps let's check in with @lbllol365 - did you make any progress on this or is it ok to reassign? |
Thanks for the clarification @CaojiamingAlan - closing. |
Should this be backported to v3.4? |
What happened?
During in-place cluster recovery etcd started reporting data corruption problems even though none existed. Problem disappears after all members are recovered.
By in-pace cluster recover I mean we recovered etcd snapshot but didn't change IP of members. In multi member cluster such recovery is done as a rolling update. This allows old and new members are able to maintain communication. Recovered members will get new cluster id preventing creating a quorum with old members. However cluster id is not checked during data corruption detection and potentially other operations done via non-raft communication.
During cluster recovery list of members doesn't change, so with in-place IPs, member belonging to new cluster might be still talking to members from old one and reverse. Recovered cluster usually recovers from older snapshot and then branches out their raft log, resulting in different hashes for the same revision. So when a member compares their hash to other member it might mistake it for corruption.
This affects all types of data corruption detection. For initial corruption detection recovered member will crashloop. For periodic corruption detection leader might mark whole cluster as corrupted.
What did you expect to happen?
Non-raft operations should give same safety as raft ones in regards to cluster recovery, meaning they should always check clusterid.
How can we reproduce it (as minimally and precisely as possible)?
TODO
Anything else we need to know?
No response
Etcd version (please run commands below)
v3.4.21
Etcd configuration (command line flags or environment variables)
N/A
Etcd debug information (please run commands below, feel free to obfuscate the IP address or FQDN in the output)
N/A
Relevant log output
No response
The text was updated successfully, but these errors were encountered: