Skip to content

Commit 09cf575

Browse files
fix
1 parent 15ae8f0 commit 09cf575

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

ydb/core/tx/columnshard/columnshard__write.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,15 @@ void TColumnShard::Handle(NEvents::TDataEvents::TEvWrite::TPtr& ev, const TActor
571571
return;
572572
}
573573

574+
auto overloadStatus = CheckOverloadedImmediate(pathId);
575+
if (overloadStatus != EOverloadStatus::None) {
576+
std::unique_ptr<NActors::IEventBase> result = NEvents::TDataEvents::TEvWriteResult::BuildError(
577+
TabletID(), 0, NKikimrDataEvents::TEvWriteResult::STATUS_OVERLOADED, "overload data error");
578+
OverloadWriteFail(overloadStatus, NEvWrite::TWriteMeta(0, pathId, source, {}, TGUID::CreateTimebased().AsGuidString()),
579+
arrowData->GetSize(), cookie, std::move(result), ctx);
580+
return;
581+
}
582+
574583
std::optional<ui32> granuleShardingVersionId;
575584
if (record.HasGranuleShardingVersionId()) {
576585
granuleShardingVersionId = record.GetGranuleShardingVersionId();
@@ -583,8 +592,7 @@ void TColumnShard::Handle(NEvents::TDataEvents::TEvWrite::TPtr& ev, const TActor
583592
lockId = record.GetLockTxId();
584593
}
585594

586-
WriteTasksQueue->TryEnqueue(
587-
this, ctx, TWriteTask(arrowData, schema, source, granuleShardingVersionId, pathId, cookie, lockId, *mType, behaviour));
595+
WriteTasksQueue->Enqueue(TWriteTask(arrowData, schema, source, granuleShardingVersionId, pathId, cookie, lockId, *mType, behaviour));
588596
WriteTasksQueue->Drain(false, ctx);
589597
}
590598

ydb/core/tx/columnshard/tablet/write_queue.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ bool TWriteTask::Execute(TColumnShard* owner, const TActorContext& ctx) {
1313
return false;
1414
}
1515

16+
owner->Counters.GetCSCounters().WritingCounters->OnWritingTaskDequeue(TMonotonic::Now() - Created);
1617
owner->OperationsManager->RegisterLock(LockId, owner->Generation());
1718
auto writeOperation = owner->OperationsManager->RegisterOperation(
1819
PathId, LockId, Cookie, GranuleShardingVersionId, ModificationType, AppDataVerified().FeatureFlags.GetEnableWritePortionsOnInsert());

0 commit comments

Comments
 (0)