@@ -1018,10 +1018,12 @@ func (n *node) commitOrAbort(pkey uint64, delta *pb.OracleDelta) error {
10181018 attribute .Int64 ("commit_ts" , int64 (commit )),
10191019 ))
10201020
1021- txn .Span .AddEvent ("Committed txn with start_ts: %d, commit_ts: %d" , trace .WithAttributes (
1022- attribute .Int64 ("start_ts" , int64 (start )),
1023- attribute .Int64 ("commit_ts" , int64 (commit )),
1024- ))
1021+ if txn .Span != nil {
1022+ txn .Span .AddEvent ("Committed txn with start_ts: %d, commit_ts: %d" , trace .WithAttributes (
1023+ attribute .Int64 ("start_ts" , int64 (start )),
1024+ attribute .Int64 ("commit_ts" , int64 (commit )),
1025+ ))
1026+ }
10251027 }
10261028
10271029 for _ , status := range delta .Txns {
@@ -1034,10 +1036,12 @@ func (n *node) commitOrAbort(pkey uint64, delta *pb.OracleDelta) error {
10341036 span .AddEvent ("Flushed to disk" )
10351037 for _ , status := range delta .Txns {
10361038 txn := posting .Oracle ().GetTxn (status .StartTs )
1037- txn .Span .AddEvent ("Flushed txn with start_ts: %d, commit_ts: %d" , trace .WithAttributes (
1038- attribute .Int64 ("start_ts" , int64 (status .StartTs )),
1039- attribute .Int64 ("commit_ts" , int64 (status .CommitTs )),
1040- ))
1039+ if txn .Span != nil {
1040+ txn .Span .AddEvent ("Flushed txn with start_ts: %d, commit_ts: %d" , trace .WithAttributes (
1041+ attribute .Int64 ("start_ts" , int64 (status .StartTs )),
1042+ attribute .Int64 ("commit_ts" , int64 (status .CommitTs )),
1043+ ))
1044+ }
10411045 }
10421046
10431047 if x .WorkerConfig .HardSync {
0 commit comments