Skip to content

Conversation

ffuugoo
Copy link
Contributor

@ffuugoo ffuugoo commented Jun 30, 2025

Currently, new custom shards are initialized directly in Active state. In this case peer A (that did not receive custom shard replica) might expect replica to already exist on peer B, but peer B might still be initializing local replica of new custom shard. This leads to annoying errors during search while custom shard is being created.

This PR tries to mitigate this by initializing replicas in Inititalizing state (so that each peer would not assume that remote replicas are instantly available) and then switching each replica into Active state after it's initialized.

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --all --all-features command?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@ffuugoo ffuugoo force-pushed the custom-shard-init branch from 13b41d5 to 4044eee Compare July 2, 2025 08:55
ffuugoo added 5 commits July 2, 2025 10:56
…ctive`

Remove explicit `send_set_replica_state_proposal` calls, because `Initializing`
replicas already switch into `Active` during `sync_local_state`
E.g., because all replicas are in `Initializing` state
@ffuugoo ffuugoo force-pushed the custom-shard-init branch from 4044eee to d4d2c25 Compare July 2, 2025 09:03
@ffuugoo ffuugoo marked this pull request as ready for review July 2, 2025 09:04
@ffuugoo ffuugoo requested review from timvisee and generall July 2, 2025 09:04

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@ffuugoo ffuugoo merged commit 3ff0a34 into dev Jul 2, 2025
18 checks passed
@ffuugoo ffuugoo deleted the custom-shard-init branch July 2, 2025 15:53
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