Add instructions for cluster consistency invariants#893
Merged
Conversation
301d699 to
e910aa2
Compare
Signed-off-by: sho-iizuka <sho-iizuka@cybozu.co.jp>
e910aa2 to
b0a8e40
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Copilot instruction set that documents the key safety/consistency invariants for MOCO’s clustering/ logic, intended to help prevent regressions that could lead to data loss or split-brain.
Changes:
- Introduced
.github/instructions/clustering.instructions.mddescribing primary/writability rules, switchover/failover sequencing, errant replica handling, and replica health criteria. - Scoped these invariants to changes under
clustering/*viaapplyTo.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: sho-iizuka <sho-iizuka@cybozu.co.jp>
4f1317c to
9dc2f25
Compare
yamatcha
approved these changes
Apr 27, 2026
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.
Summary
This PR adds
clustering.instructions.mdto the instructions directory to formally define the consistency and safety invariants of the MOCO clustering logic.Context
The clustering logic in MOCO is critical for maintaining data consistency across MySQL instances and preventing split-brain scenarios.
By adding these rules as an instruction set, we enable GitHub Copilot code review to automatically verify if new changes in
clustering/*adhere to these invariants. This provides an automated safety net to catch potential violations early in the development cycle.