Skip to content

feat: support negotiated features#878

Merged
mattisonchao merged 11 commits intomainfrom
feat.fingerprint.negociated_features
Feb 4, 2026
Merged

feat: support negotiated features#878
mattisonchao merged 11 commits intomainfrom
feat.fingerprint.negociated_features

Conversation

@mattisonchao
Copy link
Copy Markdown
Member

@mattisonchao mattisonchao commented Feb 2, 2026

Motivation

This is part 2 of https://github.com/orgs/oxia-db/discussions/849. The PR introduces the negotiated support features for the ensemble DataServer to avoid any unexpected behaviour when rolling out an upgrade or a different version.

Modification

  • Added Feature enum and GetInfo RPC to protocol
  • Coordinator collects and negotiates features during election
  • Leader stores negotiated features and exposes IsFeatureEnabled()
  • Old nodes without GetInfo are treated as supporting no features

@mattisonchao mattisonchao self-assigned this Feb 2, 2026
@mattisonchao mattisonchao marked this pull request as draft February 2, 2026 17:56
@mattisonchao mattisonchao marked this pull request as ready for review February 4, 2026 11:14
@mattisonchao mattisonchao force-pushed the feat.fingerprint.negociated_features branch from 69942f5 to f1ce3d3 Compare February 4, 2026 13:30
@mattisonchao
Copy link
Copy Markdown
Member Author

Claude Code Review


PR #878 Review: Feature Negotiation for Rolling Upgrades

Overall Assessment: ✅ Approve

This is a well-designed and implemented feature that enables safe rolling upgrades through feature negotiation. The code is clean, well-structured, and includes comprehensive test coverage.


Strengths

  1. Clean Architecture: The feature negotiation flow is well-organized:
    - feature.SupportedFeatures() - central registry of supported features
    - DataServerController.SupportedFeatures() - fetches per-node features via GetInfo RPC
    - negotiate() - computes intersection of features across quorum members
    - LeaderController.IsFeatureEnabled() - exposes negotiated features for use
  2. Backward Compatibility: Old dataservers returning codes.Unimplemented are handled gracefully in syncDataServerInfo():
    if code == codes.Unimplemented {
    n.Warn("the storage data server is too old without info endpoint.")
    return nil // Treat as success with no features
    }
  3. Robust Retry Logic: Uses exponential backoff for syncDataServerInfo() with proper error handling.
  4. Good Test Coverage: Comprehensive tests for:
    - negotiate() function with edge cases (empty input, partial support, duplicates)
    - Rolling upgrade scenarios
    - IsFeatureEnabled() behavior
    - Integration tests with mocked different-version nodes

Code Quality

  • Proto changes are clean and well-documented
  • Proper use of atomic.Value for thread-safe feature storage
  • Consistent error handling patterns
  • Good logging with structured fields

Summary

The implementation is solid and ready to merge. The feature negotiation mechanism provides a clean foundation for introducing new capabilities while maintaining backward compatibility during rolling upgrades.

@mattisonchao mattisonchao merged commit c15dddd into main Feb 4, 2026
9 checks passed
@mattisonchao mattisonchao deleted the feat.fingerprint.negociated_features branch February 4, 2026 17:25
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.

1 participant