Skip to content
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

Add support for custom provider implementation #239

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

temeo
Copy link
Contributor

@temeo temeo commented Jan 14, 2025

  • Add a set_provider_factory() method to server_state to allow
    injecting provider factory which will be called when the
    provider is loaded.

Other related changes:

  • Implement to_string() helper method for id class.
  • Fix id ostream operator human readable id printing.
  • Pass victim client_service as an argument to provider::bf_abort()
    to allow passing victim context to custom provider.
  • Implement prev() helper method for seqno class.
  • Make server_state recover_streaming_appliers_if_not_recovered()
    public. In some recovery scenarios the method must be called outside
    of server_state internal code paths.
  • Add storage_service requires_globals() method. The storage service
    implementation may override this to return false if changing to
    storage service context does not require store/reset globals.
  • Change view final() to also require that the view status is not
    primary for the view to be final. Also change the method name to
    is_final() to avoid confusion with C++ final identifier.
  • Fixes to server state handling in disconnecting and disconnected
    states.
  • Keep TOI meta data over whole TOI critical section.

@temeo temeo self-assigned this Jan 14, 2025
@temeo temeo force-pushed the grp-11.5-merge branch 3 times, most recently from 2303146 to a029cfd Compare January 14, 2025 11:06
temeo and others added 2 commits January 14, 2025 16:51
- Add a set_provider_factory() method to server_state to allow
  injecting provider factory which will be called when the
  provider is loaded.

Other related changes:
- Implement to_string() helper method for id class.
- Fix id ostream operator human readable id printing.
- Pass victim client_service as an argument to provider::bf_abort()
  to allow passing victim context to custom provider.
- Implement prev() helper method for seqno class.
- Make server_state recover_streaming_appliers_if_not_recovered()
  public. In some recovery scenarios the method must be called outside
  of server_state internal code paths.
- Add storage_service requires_globals() method. The storage service
  implementation may override this to return false if changing to
  storage service context does not require store/reset globals.
- Change view final() to also require that the view status is not
  primary for the view to be final. Also change the method name to
  is_final() to avoid confusion with C++ final identifier.
- Fixes to server state handling in disconnecting and disconnected
  states.
- Keep TOI meta data over whole TOI critical section.

Co-authored-by: Denis Protivensky <denis.protivensky@galeracluster.com>
An id is considered an alphanumeric string if it contains a
non-empty sequence of alphanumeric characters followed by
one or more null characters.

Fixed unit tests accordingly.

auto ret = (provider().leave_toi(id_, toi_meta_, err) == provider::success ? 0 : 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these lines swapped? Maybe you could add a comment to clarify?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was " Keep TOI meta data over whole TOI critical section." which didn't make it into PR description. Now updated.

leave_toi_common() resets toi_meta_, which is now passed to leave_toi().

@denis-protivensky denis-protivensky merged commit 2d7b357 into master Jan 14, 2025
26 checks passed
@denis-protivensky denis-protivensky deleted the grp-11.5-merge branch January 14, 2025 17:11
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.

2 participants