-
Notifications
You must be signed in to change notification settings - Fork 38
feat: Add cluster-level CCR sync and dynamic monitor interval configuration #636
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
Open
LemonCL
wants to merge
43
commits into
selectdb:dev
Choose a base branch
from
LemonCL:feature/cluster-ccr-sync
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
…ration This commit introduces cluster-level CCR synchronization functionality and dynamic monitor interval configuration capabilities. 1. **Cluster-level CCR Sync** - Add `ClusterSync` parameter to `CreateCcrRequest` - Implement `createClusterCcr()` function for cluster-wide database sync - Add automatic database monitoring with `startDatabaseMonitor()` - Support dynamic detection of new/deleted databases - Auto-create/remove sync tasks for database changes 2. **Dynamic Monitor Interval Configuration** - Add `/update_monitor_interval` HTTP endpoint - Add `/get_monitor_interval` HTTP endpoint - Support runtime modification of database monitoring frequency - Implement thread-safe interval updates using channels - `POST /update_monitor_interval` - Update monitoring interval - `GET /get_monitor_interval` - Get current monitoring interval - All existing single-database sync functionality remains unchanged - New `cluster_sync` parameter defaults to `false` - Thread-safe implementation using `sync.RWMutex` - Non-blocking channel communication for interval updates - Comprehensive error handling and retry mechanisms - Detailed logging for observability
feat: Add cluster-level CCR sync and dynamic monitor interval configuration This commit introduces cluster-level CCR synchronization functionality and dynamic monitor interval configuration capabilities. 1. **Cluster-level CCR Sync** - Add `ClusterSync` parameter to `CreateCcrRequest` - Implement `createClusterCcr()` function for cluster-wide database sync - Add automatic database monitoring with `startDatabaseMonitor()` - Support dynamic detection of new/deleted databases - Auto-create/remove sync tasks for database changes 2. **Dynamic Monitor Interval Configuration** - Add `/update_monitor_interval` HTTP endpoint - Add `/get_monitor_interval` HTTP endpoint - Support runtime modification of database monitoring frequency - Implement thread-safe interval updates using channels 3. **Performance Optimizations** - Optimize lock usage in `startDatabaseMonitor()` - Replace frequent lock operations with channel communication - Reduce lock contention and improve monitoring performance - `POST /update_monitor_interval` - Update monitoring interval - `GET /get_monitor_interval` - Get current monitoring interval - All existing single-database sync functionality remains unchanged - New `cluster_sync` parameter defaults to `false` - Thread-safe implementation using `sync.RWMutex` - Non-blocking channel communication for interval updates - Comprehensive error handling and retry mechanisms - Detailed logging for observability Closes: #[issue_number] docs: Add documentation for cluster CCR sync feature
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.
功能概述
本PR为CCR Syncer添加了集群级别同步功能和动态监控间隔配置功能。
主要更改
新增API端点
POST /update_monitor_interval
- 更新监控间隔GET /get_monitor_interval
- 获取当前监控间隔向后兼容性
cluster_sync
默认为false
1. 集群级别CCR同步
2. 动态监控间隔配置
API 接口
创建集群级同步任务
接口:
POST /create_ccr
请求参数:
参数说明:
cluster_sync
: 设置为true
启用集群级同步name
: 同步任务的基础名称,实际任务名会加上数据库名后缀src/dest
: 源集群和目标集群的连接信息响应示例:
更新监控间隔
接口:
POST /update_monitor_interval
请求参数:
参数说明:
interval_seconds
: 监控间隔时间(秒),必须大于0响应示例:
获取当前监控间隔
接口:
GET /get_monitor_interval
响应示例: