@@ -36,6 +36,7 @@ type ShardedCoordinator struct {
3636 defaultGroup uint64
3737 clock * HLC
3838 store store.MVCCStore
39+ log * slog.Logger
3940}
4041
4142// NewShardedCoordinator builds a coordinator for the provided shard groups.
@@ -52,6 +53,7 @@ func NewShardedCoordinator(engine *distribution.Engine, groups map[uint64]*Shard
5253 defaultGroup : defaultGroup ,
5354 clock : clock ,
5455 store : st ,
56+ log : slog .Default (),
5557 }
5658}
5759
@@ -211,7 +213,7 @@ func (c *ShardedCoordinator) commitSecondaryTxns(startTS uint64, primaryGid uint
211213 }
212214 r , err := commitSecondaryWithRetry (g , req )
213215 if err != nil {
214- slog .Warn ("txn secondary commit failed" ,
216+ c . log .Warn ("txn secondary commit failed" ,
215217 slog .Uint64 ("gid" , gid ),
216218 slog .String ("primary_key" , string (primaryKey )),
217219 slog .Uint64 ("start_ts" , startTS ),
@@ -266,7 +268,10 @@ func (c *ShardedCoordinator) abortPreparedTxn(startTS uint64, primaryKey []byte,
266268 Mutations : append ([]* pb.Mutation {meta }, pg .keys ... ),
267269 }
268270 if _ , err := g .Txn .Commit ([]* pb.Request {req }); err != nil {
269- slog .Warn ("txn abort failed; locks may remain until TTL expiry" ,
271+ if errors .Is (err , ErrTxnAlreadyCommitted ) {
272+ continue
273+ }
274+ c .log .Warn ("txn abort failed; locks may remain until TTL expiry" ,
270275 slog .Uint64 ("gid" , pg .gid ),
271276 slog .String ("primary_key" , string (primaryKey )),
272277 slog .Uint64 ("start_ts" , startTS ),
0 commit comments