Skip to content

Simplify ShardKeyMapping implementation#6220

Merged
timvisee merged 6 commits intodevfrom
shard-key-mapping-serde-refactor
Mar 24, 2025
Merged

Simplify ShardKeyMapping implementation#6220
timvisee merged 6 commits intodevfrom
shard-key-mapping-serde-refactor

Conversation

@ffuugoo
Copy link
Contributor

@ffuugoo ffuugoo commented Mar 21, 2025

This PR simplifies new ShardKeyMapping format support introduced in #6209.

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 requested a review from timvisee March 21, 2025 11:04
@ffuugoo
Copy link
Contributor Author

ffuugoo commented Mar 21, 2025

Spray and pray PR, really bet on those integration tests 🤞✅

@ffuugoo ffuugoo marked this pull request as ready for review March 21, 2025 13:04
@ffuugoo ffuugoo requested a review from generall March 21, 2025 13:04
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 21, 2025

📝 Walkthrough

Walkthrough

The pull request implements widespread changes to standardize the handling of shard key mappings across the codebase. The update replaces the previous wrapper type (ShardKeyMappingWrapper) with the new type (ShardKeyMapping) in various modules, including collection initialization, snapshot restoration, state management, and shard holder operations. Method signatures, structure fields, and import statements have been adjusted to reflect the new type, ensuring uniform behavior throughout. Additionally, minor processing changes such as adding .cloned().collect() to the get_shard_keys method and updating iteration patterns in migrations have been introduced. The refactoring in the shard mapping module encapsulates the mapping inside a struct, providing direct access through implemented traits and new methods.

Possibly related PRs

  • Fix snapshot restore with new shard key format #6202: The changes in the main PR and the retrieved PR are related as both involve modifications to the handling of ShardKeyMapping and ShardKeyMappingWrapper types within the restore_snapshot method, specifically addressing the type used for shard key mappings.
  • Fix consensus snapshot not applying shard key mappings #6212: The changes in the main PR and the retrieved PR are related as both involve modifications to the shard_key_mapping parameter in the new method of the Collection struct, specifically transitioning from ShardKeyMappingWrapper to ShardKeyMapping.

Suggested reviewers

  • generall
  • coszio

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3ec1bd0 and 1382f97.

📒 Files selected for processing (2)
  • lib/collection/src/collection/snapshots.rs (2 hunks)
  • lib/storage/src/content_manager/toc/collection_meta_ops.rs (0 hunks)
💤 Files with no reviewable changes (1)
  • lib/storage/src/content_manager/toc/collection_meta_ops.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/collection/src/collection/snapshots.rs
⏰ Context from checks skipped due to timeout of 90000ms (13)
  • GitHub Check: Basic TLS/HTTPS tests
  • GitHub Check: test-snapshot-operations-s3-minio
  • GitHub Check: test-shard-snapshot-api-s3-minio
  • GitHub Check: test-low-resources
  • GitHub Check: test-consistency
  • GitHub Check: test-consensus-compose
  • GitHub Check: test (macos-latest)
  • GitHub Check: test-consensus
  • GitHub Check: test (windows-latest)
  • GitHub Check: test
  • GitHub Check: test
  • GitHub Check: test
  • GitHub Check: test (ubuntu-latest)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (5)
lib/storage/src/content_manager/toc/collection_meta_ops.rs (1)

386-386: Unnecessary self-assignment could be removed

The line let shards_key_mapping = shards_key_mapping; is a self-assignment that doesn't perform any transformation. This was likely a result of removing the previous .to_map() call during the ShardKeyMapping simplification refactoring. Consider removing this line altogether since the original variable can be used directly.

- let shards_key_mapping = shards_key_mapping;
lib/collection/src/collection/snapshots.rs (1)

187-188: Update comment to reflect new implementation

The comment "Use wrapper type to support both formats" is now inconsistent with the implementation, which directly uses ShardKeyMapping. Update the comment to reflect the new implementation approach.

-                    // Use wrapper type to support both formats
+                    // Read the shard key mapping file
                     let shard_key_mapping: ShardKeyMapping = read_json(&mapping_path)?;
lib/collection/src/shards/shard_holder/shard_mapping.rs (3)

18-30: Consider restricting direct mutation via DerefMut.

While implementing Deref and DerefMut improves convenience, it exposes the core HashMap for mutation, potentially bypassing invariants. Consider providing explicit API methods instead to keep the mapping consistent.


32-44: Rename method for clarity.

The function name shards() might be renamed to match the “shard_id_to_shard_key” comment. This improves readability and consistency.

-    pub fn shards(&self) -> HashMap<ShardId, ShardKey> {
+    pub fn shard_id_to_shard_key(&self) -> HashMap<ShardId, ShardKey> {

101-115: Feature-flag-based serialization.

Relying on use_new_shard_key_mapping_format is fine, but to prevent confusion (e.g. numeric keys with the old format), consider forcing the new format if numeric shard keys are found. This may reduce edge cases.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f50292e and 24f51b8.

📒 Files selected for processing (8)
  • lib/collection/src/collection/mod.rs (3 hunks)
  • lib/collection/src/collection/snapshots.rs (2 hunks)
  • lib/collection/src/collection/state_management.rs (2 hunks)
  • lib/collection/src/collection_state.rs (2 hunks)
  • lib/collection/src/shards/shard_holder/mod.rs (6 hunks)
  • lib/collection/src/shards/shard_holder/shard_mapping.rs (2 hunks)
  • lib/storage/src/content_manager/toc/collection_meta_ops.rs (1 hunks)
  • src/migrations/single_to_cluster.rs (1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
lib/collection/src/collection/mod.rs (3)
lib/collection/src/shards/shard_holder/mod.rs (1) (1)
  • shards (280-280)
lib/collection/src/collection/state_management.rs (1) (1)
  • shards (183-183)
lib/collection/src/shards/shard_holder/shard_mapping.rs (1) (1)
  • shards (35-44)
🔇 Additional comments (21)
lib/collection/src/collection_state.rs (1)

26-27: Implementation matches TODO comment - good work!

This change successfully implements the TODO comment by replacing the wrapper type with the new ShardKeyMapping type.

src/migrations/single_to_cluster.rs (2)

100-100: Simplified accessing of shard key mapping entries

The change from using .to_map() to directly using .iter() on the shards_key_mapping object aligns with the overall refactoring to simplify the ShardKeyMapping implementation.


104-104: Removed reference operator when accessing shard ID

Removed the reference operator (&) from shard_id when calling get(), which matches with how the new ShardKeyMapping type handles shard IDs.

lib/collection/src/collection/state_management.rs (2)

179-179: Signature successfully updated to reflect the new type.

This change aligns well with the overall refactor to use ShardKeyMapping.


12-12:

Details

❓ Verification inconclusive

Confirm old references are fully removed.

Swapping from ShardKeyMappingWrapper to ShardKeyMapping is consistent with the new design. Please ensure no references to ShardKeyMappingWrapper remain in the codebase.


🏁 Script executed:

#!/bin/bash
rg 'ShardKeyMappingWrapper'

Length of output: 27


Let's perform a slightly more targeted search before finalizing this review comment. I'll re-run the search specifically in Rust files to be sure there are no stale references:

Once you verify that this command produces no output, we can confidently conclude that all references to ShardKeyMappingWrapper have been removed.

Rewritten Review Comment:

Ensure complete removal of ShardKeyMappingWrapper.
The change from ShardKeyMappingWrapper to ShardKeyMapping in lib/collection/src/collection/state_management.rs (line 12) aligns with the new design. Please confirm by re-running a thorough search (e.g., using rg -t rust 'ShardKeyMappingWrapper') that no lingering references to ShardKeyMappingWrapper exist anywhere in the codebase.


🏁 Script executed:

#!/bin/bash
rg -t rust 'ShardKeyMappingWrapper'

Length of output: 35


Action: Confirm removal of ShardKeyMappingWrapper from the entire codebase.
The change in lib/collection/src/collection/state_management.rs (line 12) replacing ShardKeyMappingWrapper with ShardKeyMapping follows the new design. Automated searches using both generic and Rust-specific queries have not returned any occurrences of ShardKeyMappingWrapper. However, the output was minimal, so please perform a manual review (or run an alternate search) across the repository to fully ensure no residual references remain.

lib/collection/src/collection/mod.rs (3)

50-50: Import change for the refactored type.

Switching the import to ShardKeyMapping reflects the new approach. Looks good.


108-108: Parameter type refactor.

Replacing Option<ShardKeyMappingWrapper> with Option<ShardKeyMapping> ensures consistency with the updated mapping structure.


352-353: Correct approach to return owned keys.

Using .cloned().collect() to produce a vector of owned ShardKeys is concise and clear.

lib/collection/src/shards/shard_holder/shard_mapping.rs (7)

2-2: Additional import for ops.

Importing std::ops to implement Deref and DerefMut is appropriate. No issues found.


12-16: New struct definition for simplified shard mapping.

Defining ShardKeyMapping with serde attributes and derived traits appears solid. Good job incorporating the new format handling.


58-63: Iterator logic is straightforward.

Collecting all shard IDs through iter_shard_ids is clear and follows well from using HashSet for uniqueness.


68-74: Check for multiple keys referencing the same ID.

This returns the first key found if a single shard ID appears under multiple shard keys. Please verify that such overlap cannot occur or else handle conflicts explicitly.


77-91: Backward compatibility for old vs. new storage formats.

Parsing the helper’s Old or New variants supports existing and new workflows effectively. Nicely done.


94-99: Untagged enum for flexible deserialization.

Untagged serde approach provides a seamless fallback for legacy data. Good choice here.


117-139: Simple intermediate struct for new format.

KeyIdsPair is straightforward and helps cleanly separate serialization logic. Looks good.

lib/collection/src/shards/shard_holder/mod.rs (6)

17-17: LGTM! Updated import for ShardKeyMapping.

This import change is part of the refactoring to use the direct ShardKeyMapping type instead of a wrapper.


59-59: LGTM! Updated field type from wrapper to direct type.

Changed the field type from SaveOnDiskShardKeyMappingWrapper to SaveOnDisk<ShardKeyMapping>, removing an unnecessary wrapper layer.


79-80: LGTM! Updated initialization to use direct ShardKeyMapping type.

Simplified initialization now loads a SaveOnDisk<ShardKeyMapping> directly instead of wrapping it.


119-120: LGTM! Simplified return type.

Method now returns ShardKeyMapping directly instead of wrapping it, consistent with the type simplification.


275-275: LGTM! Updated parameter type.

Changed parameter type from ShardKeyMappingWrapper to ShardKeyMapping for consistency.


132-139:

Details

❓ Verification inconclusive

LGTM! Streamlined implementation with direct mapping.

The implementation has been simplified to:

  1. Extract the shard ID to key mapping
  2. Write the mapping directly to storage
  3. Update the local cache

This is cleaner than the previous approach that required conversion to a map first.


🏁 Script executed:

#!/bin/bash
# Verify that the ShardKeyMapping type implements the necessary shards() method
ast-grep --pattern 'impl $_ for ShardKeyMapping {
  $$$
  fn shards($$$) -> $_ {
    $$$
  }
  $$$
}'

Length of output: 103


Action Required: Verify ShardKeyMapping Implementation

The updated streamlined implementation looks clean and correct. However, the initial automated check for the shards() method on ShardKeyMapping did not return output. Please manually verify that the ShardKeyMapping type indeed implements a shards() method with the correct behavior, ensuring that it returns the expected mapping.

Bullet points for review:

  • Confirm that ShardKeyMapping has an implementation of fn shards(&self) -> _ (with the correct return type) that extracts the shard ID to key mapping.
  • Ensure that the behavior of this method matches the expectations in the streamlined code (i.e., direct mapping extraction, proper updating of storage, and cache).

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
lib/collection/src/shards/shard_holder/shard_mapping.rs (2)

34-35: Consider addressing the TODO in this PR

The TODO for renaming the method is included in the PR. Consider addressing it now rather than leaving it for future work, especially if this is part of a larger API refactoring effort.


68-74: Consider addressing the TODO and potential performance issue

  1. The TODO for renaming the method is included in the PR. Consider addressing it now.
  2. The implementation searches for a shard ID in all shard keys, which could be inefficient for large mappings. If this is a frequently called method, consider adding an inverse mapping from shard ID to shard key as a field in the struct.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 24f51b8 and 2f8a986.

📒 Files selected for processing (1)
  • lib/collection/src/shards/shard_holder/shard_mapping.rs (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (13)
  • GitHub Check: test-shard-snapshot-api-s3-minio
  • GitHub Check: Basic TLS/HTTPS tests
  • GitHub Check: test-snapshot-operations-s3-minio
  • GitHub Check: test-low-resources
  • GitHub Check: test-consistency
  • GitHub Check: test-consensus-compose
  • GitHub Check: test (macos-latest)
  • GitHub Check: test-consensus
  • GitHub Check: test (windows-latest)
  • GitHub Check: test
  • GitHub Check: test
  • GitHub Check: test (ubuntu-latest)
  • GitHub Check: test
🔇 Additional comments (8)
lib/collection/src/shards/shard_holder/shard_mapping.rs (8)

2-2: Well-structured encapsulation with Deref pattern

The refactoring encapsulates the shard key mapping inside a struct with proper derive traits for serialization/deserialization, which is a better design approach than the previous type alias. Using the Deref pattern (importing std::ops) allows for backward compatibility while providing proper encapsulation.

Also applies to: 12-16


18-30: Good implementation of Deref and DerefMut

The Deref and DerefMut traits allow the struct to be used as if it were a HashMap directly, providing backward compatibility with existing code while maintaining proper encapsulation. This is a standard Rust idiom for wrapping collections.


35-44: Method implementation looks correct

The implementation of shards() correctly uses flat_map to transform the mapping from shard key to shard IDs into a mapping from shard ID to shard key. The approach is efficient and clear.


59-63: Good iterator implementation

Creating a dedicated iterator method is a good practice in Rust, allowing for more flexible and potentially more efficient code. Using copied() instead of cloning each shard ID is also more efficient.


77-92: Clean implementation of conversion from SerdeHelper

The conversion from the serialization helper to the actual struct is clean and handles both the new and old formats correctly. The matching is straightforward and maps directly to the struct field.


94-99: Good serialization strategy

Using an untagged enum for serialization is a good approach to handle multiple formats without complicating the main struct. This separates serialization concerns from the core data structure.


101-117: Format selection aligns with previous discussions

The logic for selecting between new and old formats correctly follows the requirements discussed in the previous reviews. It uses the new format if either the feature flag is enabled or if any numeric shard key is used, which preserves type information.

This implementation matches the discussion in the past review comments where using numeric shard keys should opt-in to the new format to preserve type information, even if it breaks backward compatibility.


119-141: Well-designed helper struct

The KeyIdsPair struct and its implementations are well-designed for serialization purposes. The into_parts method and From implementation make the conversion between the pair and tuple formats clean and explicit.

Copy link
Member

@timvisee timvisee left a comment

Choose a reason for hiding this comment

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

A lot cleaner. Thanks! 🙏

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
lib/collection/src/shards/shard_holder/shard_mapping.rs (2)

18-30: Consider restricting direct mutation of the internal map.
Implementing Deref and DerefMut on ShardKeyMapping exposes the internal HashMap for direct external modification, which can degrade encapsulation. If external mutation is intended, this is fine; otherwise, consider providing read/write methods to maintain stricter control.


64-72: Potential performance bottleneck for frequent lookups.
Since this performs a linear search over all keys, frequently calling shard_key(shard_id) may be costly for large data sets. Consider a dedicated reverse map if needed for performance.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2f8a986 and 3ec1bd0.

📒 Files selected for processing (5)
  • lib/collection/src/collection/mod.rs (4 hunks)
  • lib/collection/src/collection/state_management.rs (3 hunks)
  • lib/collection/src/collection_state.rs (2 hunks)
  • lib/collection/src/shards/shard_holder/mod.rs (6 hunks)
  • lib/collection/src/shards/shard_holder/shard_mapping.rs (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • lib/collection/src/collection_state.rs
  • lib/collection/src/collection/state_management.rs
  • lib/collection/src/collection/mod.rs
🧰 Additional context used
🧬 Code Definitions (1)
lib/collection/src/shards/shard_holder/shard_mapping.rs (3)
lib/common/common/src/flags.rs (1) (1)
  • feature_flags (38-46)
lib/collection/src/collection/state_management.rs (1) (1)
  • shards (183-183)
lib/collection/src/shards/shard_holder/mod.rs (1) (1)
  • shards (280-280)
⏰ Context from checks skipped due to timeout of 90000ms (13)
  • GitHub Check: test-snapshot-operations-s3-minio
  • GitHub Check: test-shard-snapshot-api-s3-minio
  • GitHub Check: test-low-resources
  • GitHub Check: Basic TLS/HTTPS tests
  • GitHub Check: test-consistency
  • GitHub Check: test-consensus
  • GitHub Check: test (macos-latest)
  • GitHub Check: test
  • GitHub Check: test (windows-latest)
  • GitHub Check: test-consensus-compose
  • GitHub Check: test (ubuntu-latest)
  • GitHub Check: test
  • GitHub Check: test
🔇 Additional comments (17)
lib/collection/src/shards/shard_holder/shard_mapping.rs (8)

2-2: No issues with adding std::ops.
This import is clearly needed for implementing Deref and DerefMut.


12-16: Structured and well-derived type definition.
The use of #[derive(Default)] along with Deserialize and Serialize streamlines the creation and persistence of ShardKeyMapping. Overall, this approach is clean.


32-43: Efficient method for reversing the shard mapping.
Generating an inverse map on-the-fly is straightforward and maintains clarity. Complexity is reasonable for most use cases.


57-62: Iterator method looks good.
The fluent approach of returning an iterator (rather than a collected list) is memory-friendly.


75-91: Deserialization logic aligns well with migrating formats.
The fallback strategy for the old format ensures backward compatibility while enabling updates to the new format.


92-105: Preserving older format under a feature flag is a sensible approach.
The plan to remove this in a future version (as noted by TODO) is clear. No issues.


107-123: Correctly switching to the new format for numeric shard keys.
This addresses previous concerns about losing numeric type information, matching user and reviewer feedback.


126-148: Helper struct and conversions are straightforward.
Round-trip conversions for (ShardKey, HashSet<ShardId>) look clean. No further recommendations.

lib/collection/src/shards/shard_holder/mod.rs (9)

17-17: Import looks appropriate.
No concerns regarding referencing ShardKeyMapping here.


59-59: Storing the mapping in SaveOnDisk is consistent.
Persisting ShardKeyMapping with the same pattern as other data structures is logical and maintains uniformity.


79-80: Initialization strategy makes sense.
Using load_or_init_default is straightforward for ensuring the mapping is present after restarts.


119-120: Simple getter returning a cloned mapping.
This is fine if returning a full copy is expected. Monitor performance if the mapping grows large.


132-133: Straightforward signature update.
Accepting a plain ShardKeyMapping parameter aligns with the new design.


134-135: Good use of shard_id_to_shard_key().
Generating the inverse map once prevents repeated computation, improving readability and performance.


137-138: Overwriting the stored mapping is handled cleanly.
Using .write_optional with Some(shard_key_mapping) is clear and consistent with the rest of the codebase.


139-140: Properly caching the inverse mapping in memory.
No issues with synchronizing it right after the write operation.


275-276: apply_shards_state parameter update is consistent.
Integrating ShardKeyMapping aligns the method with the rest of the refactor.

ffuugoo added 2 commits March 21, 2025 17:16
Remove unnecessary assignment
Remove misleading comment
@timvisee
Copy link
Member

I consider this to be done. Thanks! 🙏

@timvisee timvisee merged commit 5a91e31 into dev Mar 24, 2025
17 checks passed
@timvisee timvisee deleted the shard-key-mapping-serde-refactor branch March 24, 2025 13:09
timvisee added a commit that referenced this pull request Mar 31, 2025
* Simplify `ShardKeyMapping` impl

* Automatically switch to new mappings format, if `Number` shard key is used

* Apply TODOs

* Add comment describing the issue, leave instructions for migration

* Cleanup

Remove unnecessary assignment

* Cleanup

Remove misleading comment

---------

Co-authored-by: timvisee <tim@visee.me>
@coderabbitai coderabbitai bot mentioned this pull request Apr 1, 2025
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