Repository navigation
feat(network): Raft-coordinated load balancer with all 5 routing strategies (v1.8.0, Issue #78) - #4245
Merged
makr-code merged 4 commits intoMar 15, 2026
Conversation
…ssue #78) - include/network/raft_load_balancer.h: Full header with Config, Backend, Stats, RaftRole and all 5 load-balancing strategies - src/network/raft_load_balancer.cpp: Production implementation with health-check loop, Raft election loop, dynamic weight rebalancing, cross-DC routing - tests/test_raft_load_balancer.cpp: 26 focused unit tests covering all 14 ACs - tests/CMakeLists.txt: Add RaftLoadBalancerFocusedTests target + fix 3 pre-existing CMake parse errors (interleaved/unclosed blocks) - .github/workflows/load-balancing-raft-coordination-ci.yml: CI workflow Co-authored-by: makr-code <[email protected]>
- Remove dead code in AC2/AC3 health test cases (single lb instance) - Fix start() double-start detection using separate started_ atomic flag - Implement proper Nginx smooth weighted round-robin with persistent per-backend effective weights (wrr_effective_weights_ map) - All 26 tests pass Co-authored-by: makr-code <[email protected]>
Copilot
AI
changed the title
[WIP] Add load balancing with Raft coordination for network domain
feat(network): Load Balancing with Raft Coordination (v1.8.0)
Mar 15, 2026
…rk macro for tests - cmake/ModularBuild.cmake: add raft_load_balancer.cpp to THEMIS_NETWORK_SOURCES so the class is compiled into themis_core (not only in the focused test binary) - tests/CMakeLists.txt: replace custom test block with add_network_focused_test macro call — links against themis_core, removes duplicate source compilation, consistent with all other focused network tests Co-authored-by: makr-code <[email protected]>
Copilot
AI
changed the title
feat(network): Load Balancing with Raft Coordination (v1.8.0)
feat(network): Raft-coordinated load balancer with all 5 routing strategies (v1.8.0, Issue #78)
Mar 15, 2026
makr-code
marked this pull request as ready for review
March 15, 2026 10:31
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.
Implements
RaftLoadBalancer— a Raft-consensus-based load balancer for distributed query routing with health monitoring, dynamic rebalancing, and cross-datacenter affinity.Description
Core implementation
include/network/raft_load_balancer.h—RaftLoadBalancerwith nestedConfig,Backend,Stats;LoadBalancingStrategyandRaftRoleenums; full thread-safe APIsrc/network/raft_load_balancer.cpp— Production implementation:consecutive_failures/consecutive_successescounters, configurableunhealthy_threshold/recovery_threshold, automatic failover + re-admissionwrr_effective_weights_), Health-Based, FNV-1a Consistent Hashrebalance_thresholdprefer_local_datacenterwith fallback to all healthy backendsstart()/stop()viastarted_atomic flagBuild integration (audit fix)
cmake/ModularBuild.cmake— Addedraft_load_balancer.cpptoTHEMIS_NETWORK_SOURCESso the class is compiled intothemis_core, not only in the test binarytests/CMakeLists.txt— Replaced custom test block withadd_network_focused_testmacro (links againstthemis_core, no duplicate source compilation — consistent with all other focused network tests); fixed 3 pre-existing interleaved CMakeif/endifblocksTests & CI
tests/test_raft_load_balancer.cpp— 26 tests covering all 14 acceptance criteria (AC1–AC14): leader election, failover, recovery, per-strategy routing, WRR distribution, consistent-hash determinism, cross-DC fallback, stats tracking.github/workflows/load-balancing-raft-coordination-ci.yml— Matrix CI on gcc-12, clang-15, gcc-13Type of Change
Testing
📚 Research & Knowledge (wenn applicable)
/docs/research/angelegt?/docs/research/implementation_influence/eingetragen?Relevante Quellen:
Checklist
Original prompt
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.