Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion kv/fsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,20 @@ func (f *kvFSM) verifyOwnerFromSnapshot(mutations []*pb.Mutation, snap RouteSnap
if isTxnInternalKey(mut.Key) {
continue
}
owner, found := snap.OwnerOf(mut.Key)
// Issue #930 fix: normalize the raw mutation key through
// routeKey() before consulting OwnerOf — the same way
// ShardRouter.ResolveGroup and ShardStore.GetAt route on the
// engine side. Without this, raw adapter keys (e.g.
// "!ddb|meta|table|<base64>") are compared byte-wise against
// routing keys (e.g. "!ddb|route|table|<base64>") which sit in
// a completely different lexicographical band, yielding a
// wrong-group verdict and a spurious ErrComposed1Violation on
// every adapter write. Reproduced by PR #911-#925 M5a
// multi-table workload: every DynamoDB CreateTable / write to
// a group-2 table was rejected because OwnerOf saw the raw
// "!ddb|meta|..." key fall into group 1 instead of the routing
// key's actual group-2 range.
owner, found := snap.OwnerOf(routeKey(mut.Key))
if !found || owner != f.shardGroupID {
return errors.Wrapf(ErrComposed1Violation,
"%s-version v=%d: key %q owned by group %d (found=%v); this FSM serves group %d",
Expand Down
Loading