Skip to content

chore: implement circuit breaker#6

Merged
d-bytebase merged 9 commits intomainfrom
circuit-breaker
Oct 2, 2025
Merged

chore: implement circuit breaker#6
d-bytebase merged 9 commits intomainfrom
circuit-breaker

Conversation

@vsai12
Copy link
Copy Markdown

@vsai12 vsai12 commented Oct 2, 2025

Problem
gh-ost's binlog syncer retries authentication failures indefinitely at 1-second intervals, causing retry storms with 800,000+ attempts that trigger enterprise firewall blocks and service disruptions.

Solution
Added circuit breaker that stops after MaxAuthFailures attempts (default: 10). The implementation tracks authentication failures using MySQL error codes (1045, 1130, etc.), stops the migration gracefully after the threshold, and resets the counter on successful connections. This reduces retry storms from hours/millions of attempts to ~10 seconds/10 attempts, preventing firewall blocks while maintaining backward compatibility when MaxAuthFailures=0.

@vsai12 vsai12 requested a review from d-bytebase October 2, 2025 20:30
Copy link
Copy Markdown

@d-bytebase d-bytebase left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some PR descriptions about what the problem is? Code looks good though.

@vsai12 vsai12 requested a review from d-bytebase October 2, 2025 20:55
@d-bytebase d-bytebase merged commit 35e5ddd into main Oct 2, 2025
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants