feat(cluster): add maintenance service with defrag, alarm, and status#117
Merged
Conversation
Add AetherMaintenance gRPC service providing operational tools: - Defrag: compact user data column families (default, mvcc) to reclaim disk space via spawn_blocking to avoid blocking the async runtime. - Alarm: activate/acknowledge/get cluster-wide alarms (NOSPACE, CORRUPT) backed by a thread-safe in-memory AlarmManager. - Status: return node status including version, db size, raft commit/applied index, raft term, and learner status (computed dynamically from members). Expose raft term through RaftHandle trait by tracking it in RaftSharedState, updated on every event loop tick and ready cycle.
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
Add
AetherMaintenancegRPC service providing operational tools for cluster maintenance: Defrag, Alarm, and Status.Changes
Defrag,Alarm,StatusRPCs,AlarmTypeenum (NONE,NOSPACE,CORRUPT),AlarmActionenum (GET,ACTIVATE,ACKNOWLEDGE).AlarmManagerwithactivate,acknowledge,get_all,has_alarm. 7 unit tests.AlarmManagerandAlarmType.MaintenanceServiceimplementing all 3 RPCs.defragruns viaspawn_blocking.alarmvalidates action/alarm_type and delegates toAlarmManager.statusreturns real raft term, commit/applied index, db sizes, and dynamic learner status.defrag()compacts onlydefaultandmvccCFs.approximate_size()usesrocksdb.total-sst-files-size.approximate_mem_usage()usesrocksdb.estimate-live-data-size.term: AtomicU64toRaftSharedState, updated on every tick and ready cycle.fn term(&self) -> u64toRaftHandletrait.term()reading from shared state.AlarmManagerandMaintenanceServiceinto gRPC server.proto/maintenance.prototo compilation.Testing
cargo clippy -- -D warnings— no new warnings (pre-existing in raftrs_store.rs)cargo fmt -- --check— cleanHow to verify
cargo build cargo test -p aether --lib cargo clippy --all-targets -- -D warnings cargo fmt -- --checkRelated issues
Refs #88