-
Type: Improvement
-
Resolution: Works as Designed
-
Priority: Minor - P4
-
None
-
Affects Version/s: 3.4.18, 4.0.3
-
Component/s: Sharding
-
Sharding EMEA
-
Sharding EMEA 2023-05-15, Sharding EMEA 2023-05-29
-
(copied to CRM)
I have attached a reproduction of a 3.4 sharded cluster moving from 2 to three shards with ranges in place.
This has a compound shard key:
sh.shardCollection("trev.historicTrackingEvent", {platformVehicleIdentifier: 1, triggerTime: 1})
This works:
sh.addTagRange("trev.historicTrackingEvent", { platformVehicleIdentifier: MinKey}, { platformVehicleIdentifier: "8" }, "A" // Zone A );
and defaults triggerTime to MinKey
However,
sh.removeTagRange("trev.historicTrackingEvent", { platformVehicleIdentifier: MinKey}, { platformVehicleIdentifier: "8" }, "A" );
gives
{ok:1}but leaves the config in config.tags.
It needs to be changed to the following with explicit triggerTime values:
sh.removeTagRange("trev.historicTrackingEvent", { platformVehicleIdentifier: MinKey, triggerTime: MinKey}, { platformVehicleIdentifier: "8" , triggerTime: MinKey}, "A" // Zone A );
This was quite confusing and hard to troubleshoot. Perhaps sh.removeTagRange should return ok:0 when no tags match, and/or include a message? And/or use the same logic as in sh.addTagRange to default the second field to MinKey?
- is related to
-
SERVER-77216 sh.removeTagRange ignores the tagName parameter
- Closed