Skip to content

Commit 1002b94

Browse files
remove useless locks broking checker (#9650)
1 parent e2d1d75 commit 1002b94

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

ydb/core/tx/columnshard/blobs_action/transaction/tx_write.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,11 @@ void TTxWrite::Complete(const TActorContext& ctx) {
151151
if (!writeMeta.HasLongTxId()) {
152152
auto op = Self->GetOperationsManager().GetOperationVerified((TOperationWriteId)writeMeta.GetWriteId());
153153
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+
}
157159
}
158160
if (op->GetBehaviour() == EOperationBehaviour::NoTxWrite) {
159161
Self->OperationsManager->AddTemporaryTxLink(op->GetLockId());

ydb/core/tx/columnshard/operations/manager.h

+4
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ class TOperationsManager {
208208
}
209209
}
210210

211+
bool HasReadLocks(const ui64 pathId) const {
212+
return InteractionsContext.HasReadIntervals(pathId);
213+
}
214+
211215
TOperationsManager();
212216

213217
private:

ydb/core/tx/columnshard/transactions/locks/interaction.h

+4
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,10 @@ class TInteractionsContext {
400400
THashMap<ui64, TReadIntervals> ReadIntervalsByPathId;
401401

402402
public:
403+
bool HasReadIntervals(const ui64 pathId) const {
404+
return ReadIntervalsByPathId.contains(pathId);
405+
}
406+
403407
NJson::TJsonValue DebugJson() const {
404408
NJson::TJsonValue result = NJson::JSON_MAP;
405409
for (auto&& i : ReadIntervalsByPathId) {

0 commit comments

Comments
 (0)