Skip to content

[protocol] Add new store schema for store lifecycle configs #1912

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
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

misyel
Copy link
Contributor

@misyel misyel commented Jul 7, 2025

Problem Statement

After a version is swapped in the target region for a colo by colo push w/ deferred swap, we will perform validation. The validations will produce either a PROCEED (continue with the roll forward) or a ROLL_BACK (do not roll forward and roll back the target region) and the validations will be configurable via implementing the StoreLifecycleHooks class. To support different implementations of the StoreLifecycleHooks class, we will need to introduce a new field in the store schema to store the implementation to use

Solution

Introduce a new field, storeLifecycleHooksConfig, in the store metavalue and admin operation schema. The storeLifecycleHooksConfig will be a record and it will contain two fields in the record: storeLifecycleHooksClassName and storeLifecycleHooksParams. storeLifecycleHooksClassName will be the FQCN of the StoreLifecycleHooks implementation and storeLifecycleHooksParams will optionally provide additional args to the StoreLifecycleHooks implementation

The new schema looks like so:

{
              "name": "StoreLifecycleHooks",
              "doc": "List of store lifecycle hooks",
              "type": {
                "type": "array",
                "items": {
                  "name": "StoreLifecycleHooksRecord",
                  "type": "record",
                  "fields": [
                    {"name": "storeLifecycleHooksClassName", "type": "string", "doc":  "FQCN of the hook implementation"},
                    {"name": "storeLifecycleHooksParams", "type": {"type": "map", "values": "string"}, "doc":  "Bag of properties to pass into the hook implementation"}
                  ]
                }
              },
              "default": []
}

Code changes

  • Added new code behind a config. If so list the config names and their default values in the PR description.
  • Introduced new log lines.
    • Confirmed if logs need to be rate limited to avoid excessive logging.

Concurrency-Specific Checks

Both reviewer and PR author to verify

  • Code has no race conditions or thread safety issues.
  • Proper synchronization mechanisms (e.g., synchronized, RWLock) are used where needed.
  • No blocking calls inside critical sections that could lead to deadlocks or performance degradation.
  • Verified thread-safe collections are used (e.g., ConcurrentHashMap, CopyOnWriteArrayList).
  • Validated proper exception handling in multi-threaded code to avoid silent thread termination.

How was this PR tested?

  • New unit tests added.
  • New integration tests added.
  • Modified or extended existing tests.
  • Verified backward compatibility (if applicable).

n/a. This pr only adds in the new avro schemas.

Does this PR introduce any user-facing or breaking changes?

  • No. You can skip the rest of this section.
  • Yes. Clearly explain the behavior change and its impact.

@misyel misyel changed the title [compat][protocol] Add new store schema for store lifecycle configs [protocol] Add new store schema for store lifecycle configs Jul 8, 2025
@misyel misyel requested a review from FelixGV July 15, 2025 00:20
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