Skip to content

Commit 01aac5b

Browse files
committed
Refactor txn timestamp assignment logic
1 parent 433db20 commit 01aac5b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

adapter/internal.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,13 @@ func (i *Internal) Forward(_ context.Context, req *pb.ForwardRequest) (*pb.Forwa
3737

3838
// Ensure leader issues start_ts when followers forward txn groups without it.
3939
if req.IsTxn {
40+
var startTs uint64
4041
for _, r := range req.Requests {
4142
if r.Ts == 0 {
42-
r.Ts = i.clock.Next()
43+
if startTs == 0 {
44+
startTs = i.clock.Next()
45+
}
46+
r.Ts = startTs
4347
}
4448
}
4549
}

0 commit comments

Comments
 (0)