Conversation
SaiPisey2
added a commit
to SaiPisey2/thanos
that referenced
this pull request
Sep 1, 2026
Signed-off-by: SaiPisey2 <piseysai0202@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9003 +/- ##
=======================================
Coverage 64.57% 64.57%
=======================================
Files 289 289
Lines 37410 37410
=======================================
Hits 24156 24156
Misses 11155 11155
Partials 2099 2099 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…errides getShardSize switched on the matcher type and only handled the explicit "exact" value, so an override that left tenant_matcher_type unset matched no case and was skipped. The tenant silently fell back to the default shard size, which breaks the determinism the override is there to provide. An empty matcher type already means exact everywhere else: it is documented on TenantMatcherTypeExact and handled by isExactMatcher, which tenantSet.match uses. Use the same helper here. Signed-off-by: SaiPisey2 <piseysai0202@gmail.com>
Signed-off-by: SaiPisey2 <piseysai0202@gmail.com>
SaiPisey2
force-pushed
the
fix/shuffle-sharding-empty-tenant-matcher
branch
from
September 18, 2026 08:33
8dee2c9 to
0460f48
Compare
Author
|
Rebased onto main. The conflict was only the changelog, where #9014 landed in the same 26 checks pass. Ready for review whenever someone has a moment. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Fixes #8983.
getShardSizeswitched on the matcher type and only handled the explicitexactvalue:An override that leaves
tenant_matcher_typeunset therefore matches no case and is skipped, so the tenant silently falls back to the default shard size — losing the routing determinism the override exists to provide.Empty already means exact everywhere else in the package: it is documented on
TenantMatcherTypeExact("This is also the default one"), andisExactMatchertreats""and"exact"alike fortenantSet.match. This uses that same helper so the two paths agree.Verification
Added
TestShuffleShardHashringGetShardSize, covering an override with no matcher type, one with an explicitexact, a glob, and a tenant with no override. The unset case returns 2 instead of 3 on main and passes here.Note three tests fail on
mainin my environment (darwin/arm64), unrelated to this change and present before it:TestRelabelWithUnsetValidationScheme,TestKetamaHashringEvenNodeSpreadandwritecapnp.TestMarshalWriteRequest.