Skip to content

Commit 890f287

Browse files
committed
feat: Add configuration hot reload and MySQL failover detection
Implement zero-downtime operational resilience features: - SIGHUP handler for runtime configuration reload without restart - Automatic MySQL failover detection via server UUID validation - ConnectionValidator class for comprehensive connection checks - GTID mode verification - Table existence validation - Server UUID tracking and change detection - Integration with BinlogReader for validation on connect/reconnect - Graceful degradation: continue with current config if reload fails - Structured logging for monitoring and alerting Test coverage: - Unit tests for ConnectionValidator (mock-based) - Integration tests with real MySQL (GTID required) - All 1200+ tests passing Documentation: - Bilingual operations guide (docs/{en,ja}/operations.md) - SIGHUP usage and monitoring procedures - Failover scenarios and troubleshooting - Updated README_ja.md with feature descriptions Implementation files: - src/main.cpp: SIGHUP signal handler and config reload logic - src/mysql/connection_validator.{h,cpp}: Validation implementation - src/mysql/binlog_reader.{h,cpp}: UUID tracking and validation calls - tests/mysql/connection_validator_test.cpp: Comprehensive test suite
1 parent 486e88b commit 890f287

File tree

12 files changed

+2101
-1
lines changed

12 files changed

+2101
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ See [Protocol Reference](docs/en/protocol.md) for all commands.
131131

132132
- **Fast**: 25-200x faster than MySQL FULLTEXT
133133
- **MySQL Replication**: Real-time GTID-based binlog streaming
134+
- **Configuration Hot Reload**: SIGHUP signal for zero-downtime config changes
135+
- **Failover Detection**: Automatic MySQL master failover detection and validation
134136
- **Multiple Tables**: Index multiple tables in one instance
135137
- **Dual Protocol**: TCP (memcached-style) and HTTP/REST API
136138
- **High Concurrency**: Thread pool supporting 10,000+ connections
@@ -175,6 +177,7 @@ MygramDB acts as a specialized read replica for full-text search, while MySQL ha
175177
- [HTTP API Reference](docs/en/http-api.md) - REST API documentation
176178
- [Performance Guide](docs/en/performance.md) - Benchmarks and optimization
177179
- [Replication Guide](docs/en/replication.md) - MySQL replication setup
180+
- [Operations Guide](docs/en/operations.md) - Configuration hot reload and failover detection
178181
- [Installation Guide](docs/en/installation.md) - Build from source
179182
- [Development Guide](docs/en/development.md) - Contributing guidelines
180183
- [Client Library](docs/en/libmygramclient.md) - C/C++ client library

README_ja.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ GET articles 12345
131131

132132
- **高速**: MySQL FULLTEXT より25〜200倍高速
133133
- **MySQL レプリケーション**: GTID ベースのリアルタイム binlog ストリーミング
134+
- **設定ホットリロード**: SIGHUP シグナルでサーバー再起動なしに設定変更が可能
135+
- **フェイルオーバー対応**: MySQL マスター切り替えを自動検出し、無効なサーバーへのレプリケーションを防止
134136
- **複数テーブル対応**: 単一インスタンスで複数テーブルのインデックス化
135137
- **デュアルプロトコル**: TCP(memcachedスタイル)と HTTP/REST API
136138
- **高並行性**: 10,000以上の同時接続をサポートするスレッドプール
@@ -175,6 +177,7 @@ MygramDB は全文検索専用の読み取りレプリカとして機能し、My
175177
- [HTTP API リファレンス](docs/ja/http-api.md) - REST API ドキュメント
176178
- [パフォーマンスガイド](docs/ja/performance.md) - ベンチマークと最適化
177179
- [レプリケーションガイド](docs/ja/replication.md) - MySQL レプリケーション設定
180+
- [運用ガイド](docs/ja/operations.md) - 設定ホットリロードとフェイルオーバー検出
178181
- [インストールガイド](docs/ja/installation.md) - ソースからビルド
179182
- [開発ガイド](docs/ja/development.md) - コントリビューションガイドライン
180183
- [クライアントライブラリ](docs/ja/libmygramclient.md) - C/C++ クライアントライブラリ

0 commit comments

Comments
 (0)