File tree 3 files changed +13
-3
lines changed
3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -151,9 +151,11 @@ void TTxWrite::Complete(const TActorContext& ctx) {
151
151
if (!writeMeta.HasLongTxId ()) {
152
152
auto op = Self->GetOperationsManager ().GetOperationVerified ((TOperationWriteId)writeMeta.GetWriteId ());
153
153
if (op->GetBehaviour () == EOperationBehaviour::WriteWithLock || op->GetBehaviour () == EOperationBehaviour::NoTxWrite) {
154
- auto evWrite = std::make_shared<NOlap::NTxInteractions::TEvWriteWriter>(writeMeta.GetTableId (),
155
- buffer.GetAggregations ()[i]->GetRecordBatch (), Self->GetIndexOptional ()->GetVersionedIndex ().GetPrimaryKey ());
156
- Self->GetOperationsManager ().AddEventForLock (*Self, op->GetLockId (), evWrite);
154
+ if (op->GetBehaviour () != EOperationBehaviour::NoTxWrite || Self->GetOperationsManager ().HasReadLocks (writeMeta.GetTableId ())) {
155
+ auto evWrite = std::make_shared<NOlap::NTxInteractions::TEvWriteWriter>(writeMeta.GetTableId (),
156
+ buffer.GetAggregations ()[i]->GetRecordBatch (), Self->GetIndexOptional ()->GetVersionedIndex ().GetPrimaryKey ());
157
+ Self->GetOperationsManager ().AddEventForLock (*Self, op->GetLockId (), evWrite);
158
+ }
157
159
}
158
160
if (op->GetBehaviour () == EOperationBehaviour::NoTxWrite) {
159
161
Self->OperationsManager ->AddTemporaryTxLink (op->GetLockId ());
Original file line number Diff line number Diff line change @@ -208,6 +208,10 @@ class TOperationsManager {
208
208
}
209
209
}
210
210
211
+ bool HasReadLocks (const ui64 pathId) const {
212
+ return InteractionsContext.HasReadIntervals (pathId);
213
+ }
214
+
211
215
TOperationsManager ();
212
216
213
217
private:
Original file line number Diff line number Diff line change @@ -400,6 +400,10 @@ class TInteractionsContext {
400
400
THashMap<ui64, TReadIntervals> ReadIntervalsByPathId;
401
401
402
402
public:
403
+ bool HasReadIntervals (const ui64 pathId) const {
404
+ return ReadIntervalsByPathId.contains (pathId);
405
+ }
406
+
403
407
NJson::TJsonValue DebugJson () const {
404
408
NJson::TJsonValue result = NJson::JSON_MAP;
405
409
for (auto && i : ReadIntervalsByPathId) {
You can’t perform that action at this time.
0 commit comments