@@ -9,17 +9,20 @@ LWTRACE_USING(DATASHARD_PROVIDER)
9
9
10
10
namespace NKikimr::NDataShard {
11
11
12
- TDataShard::TTxWrite::TTxWrite (TDataShard* self, NEvents::TDataEvents::TEvWrite::TPtr ev, TInstant receivedAt, ui64 tieBreakerIndex, bool delayed)
13
- : TBase (self, std::move (ev->TraceId ))
12
+ TDataShard::TTxWrite::TTxWrite (TDataShard* self,
13
+ NEvents::TDataEvents::TEvWrite::TPtr ev,
14
+ TInstant receivedAt,
15
+ ui64 tieBreakerIndex,
16
+ bool delayed,
17
+ NWilson::TSpan &&datashardTransactionSpan)
18
+ : TBase (self, datashardTransactionSpan.GetTraceId ())
14
19
, Ev (std::move (ev))
15
20
, ReceivedAt (receivedAt)
16
21
, TieBreakerIndex (tieBreakerIndex)
17
22
, TxId (Ev->Get ()->GetTxId ())
18
23
, Acked (!delayed)
19
- , ProposeTransactionSpan (TWilsonKqp::ProposeTransaction, TxSpan.GetTraceId (), " ProposeTransaction" , NWilson::EFlags::AUTO_END)
20
- {
21
- ProposeTransactionSpan.Attribute (" Shard" , std::to_string (self->TabletID ()));
22
- }
24
+ , DatashardTransactionSpan (std::move (datashardTransactionSpan))
25
+ { }
23
26
24
27
bool TDataShard::TTxWrite::Execute (TTransactionContext& txc, const TActorContext& ctx) {
25
28
LOG_TRACE_S (ctx, NKikimrServices::TX_DATASHARD, " TTxWrite:: execute at tablet# " << Self->TabletID ());
@@ -54,9 +57,7 @@ bool TDataShard::TTxWrite::Execute(TTransactionContext& txc, const TActorContext
54
57
TActorId target = Op ? Op->GetTarget () : Ev->Sender ;
55
58
ui64 cookie = Op ? Op->GetCookie () : Ev->Cookie ;
56
59
57
- if (ProposeTransactionSpan) {
58
- ProposeTransactionSpan.EndOk ();
59
- }
60
+ DatashardTransactionSpan.EndOk ();
60
61
ctx.Send (target, result.release (), 0 , cookie);
61
62
62
63
return true ;
@@ -71,17 +72,14 @@ bool TDataShard::TTxWrite::Execute(TTransactionContext& txc, const TActorContext
71
72
return true ;
72
73
}
73
74
74
- TOperation::TPtr op = Self->Pipeline .BuildOperation (Ev, ReceivedAt, TieBreakerIndex, txc, ctx, ProposeTransactionSpan. GetTraceId ( ));
75
+ TOperation::TPtr op = Self->Pipeline .BuildOperation (Ev, ReceivedAt, TieBreakerIndex, txc, ctx, std::move (DatashardTransactionSpan ));
75
76
TWriteOperation* writeOp = TWriteOperation::CastWriteOperation (op);
76
77
77
78
// Unsuccessful operation parse.
78
79
if (op->IsAborted ()) {
79
80
LWTRACK (ProposeTransactionParsed, op->Orbit , false );
80
81
Y_ABORT_UNLESS (writeOp->GetWriteResult ());
81
-
82
- if (ProposeTransactionSpan) {
83
- ProposeTransactionSpan.EndError (" TTxWrite:: unsuccessful operation parse" );
84
- }
82
+ op->OperationSpan .EndError (" Unsuccessful operation parse" );
85
83
ctx.Send (op->GetTarget (), writeOp->ReleaseWriteResult ().release ());
86
84
return true ;
87
85
}
@@ -159,10 +157,6 @@ bool TDataShard::TTxWrite::Execute(TTransactionContext& txc, const TActorContext
159
157
void TDataShard::TTxWrite::Complete (const TActorContext& ctx) {
160
158
LOG_TRACE_S (ctx, NKikimrServices::TX_DATASHARD, " TTxWrite complete: at tablet# " << Self->TabletID ());
161
159
162
- if (ProposeTransactionSpan) {
163
- ProposeTransactionSpan.End ();
164
- }
165
-
166
160
if (Op) {
167
161
Y_ABORT_UNLESS (!Op->GetExecutionPlan ().empty ());
168
162
if (!CompleteList.empty ()) {
0 commit comments