Skip to content

Commit 515b64d

Browse files
nsofyansofya
andauthored
Sync with 24 1 (#4628)
Co-authored-by: nsofya <nsofya@yandex.ru>
1 parent be4c88f commit 515b64d

File tree

8 files changed

+32
-6
lines changed

8 files changed

+32
-6
lines changed

ydb/core/tx/columnshard/columnshard__init.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ bool TTxUpdateSchema::Execute(TTransactionContext& txc, const TActorContext&) {
272272
if (result.IsSuccess()) {
273273
NormalizerTasks = result.DetachResult();
274274
if (!NormalizerTasks.empty()) {
275+
ACFL_WARN("normalizer_controller", Self->NormalizerController.DebugString())("tasks_count", NormalizerTasks.size());
275276
break;
276277
}
277278
NIceDb::TNiceDb db(txc.DB);
@@ -337,6 +338,7 @@ bool TTxApplyNormalizer::Execute(TTransactionContext& txc, const TActorContext&)
337338
void TTxApplyNormalizer::Complete(const TActorContext& ctx) {
338339
AFL_INFO(NKikimrServices::TX_COLUMNSHARD)("step", "TTxApplyNormalizer.Complete")("tablet_id", Self->TabletID())("event", "initialize_shard");
339340
AFL_VERIFY(!Self->NormalizerController.IsNormalizationFinished())("details", Self->NormalizerController.DebugString());
341+
AFL_WARN(NKikimrServices::TX_COLUMNSHARD)("tablet_id", Self->TabletID())("event", "apply_normalizer_changes")("details", Self->NormalizerController.DebugString())("size", Changes->GetSize());
340342
Changes->ApplyOnComplete(Self->NormalizerController);
341343
Self->NormalizerController.GetNormalizer()->OnResultReady();
342344
if (Self->NormalizerController.GetNormalizer()->HasActiveTasks()) {

ydb/core/tx/columnshard/normalizer/abstract/abstract.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ namespace NKikimr::NOlap {
5353
enum class ENormalizerSequentialId : ui32 {
5454
Granules = 1,
5555
Chunks,
56-
PortionsMetadata,
5756
PortionsCleaner,
58-
TablesCleaner
57+
TablesCleaner,
58+
PortionsMetadata,
5959
};
6060

6161
class TNormalizationContext {
@@ -88,14 +88,18 @@ namespace NKikimr::NOlap {
8888
virtual void ApplyOnComplete(const TNormalizationController& normalizationContext) const {
8989
Y_UNUSED(normalizationContext);
9090
}
91+
92+
virtual ui64 GetSize() const = 0;
9193
};
9294

9395
class TTrivialNormalizerTask : public INormalizerTask {
9496
INormalizerChanges::TPtr Changes;
9597
public:
9698
TTrivialNormalizerTask(const INormalizerChanges::TPtr& changes)
9799
: Changes(changes)
98-
{}
100+
{
101+
AFL_VERIFY(Changes);
102+
}
99103

100104
void Start(const TNormalizationController& /* controller */, const TNormalizationContext& /*nCtx*/) override;
101105
};
@@ -136,9 +140,8 @@ namespace NKikimr::NOlap {
136140

137141
virtual ENormalizerSequentialId GetType() const = 0;
138142

139-
const TString& GetName() const {
140-
static TString name = ToString(GetType());
141-
return name;
143+
TString GetName() const {
144+
return ToString(GetType());
142145
}
143146

144147
ui32 GetSequentialId() const {

ydb/core/tx/columnshard/normalizer/granule/normalizer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ class TGranulesNormalizer::TNormalizerResult : public INormalizerChanges {
4848
return true;
4949
}
5050

51+
ui64 GetSize() const override {
52+
return Chunks.size();
53+
}
54+
5155
static std::optional<std::vector<INormalizerChanges::TPtr>> Init(const TNormalizationController& controller, NTabletFlatExecutor::TTransactionContext& txc) {
5256
using namespace NColumnShard;
5357
NIceDb::TNiceDb db(txc.DB);

ydb/core/tx/columnshard/normalizer/portion/chunks.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ class TChunksNormalizer::TNormalizerResult : public INormalizerChanges {
3434
}
3535
return true;
3636
}
37+
38+
ui64 GetSize() const override {
39+
return Chunks.size();
40+
}
3741
};
3842

3943
class TRowsAndBytesChangesTask: public NConveyor::ITask {

ydb/core/tx/columnshard/normalizer/portion/clean.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ class TBlobsRemovingResult : public INormalizerChanges {
3434
void ApplyOnComplete(const TNormalizationController& /* normController */) const override {
3535
RemovingAction->OnCompleteTxAfterRemoving(true);
3636
}
37+
38+
ui64 GetSize() const override {
39+
return Portions.size();
40+
}
3741
};
3842

3943
class TBlobsRemovingTask : public INormalizerTask {

ydb/core/tx/columnshard/normalizer/portion/portion.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ class TPortionsNormalizer::TNormalizerResult : public INormalizerChanges {
2929
}
3030
return true;
3131
}
32+
33+
ui64 GetSize() const override {
34+
return Portions.size();
35+
}
3236
};
3337

3438
bool TPortionsNormalizer::CheckPortion(const NColumnShard::TTablesManager&, const TPortionInfo& portionInfo) const {

ydb/core/tx/columnshard/normalizer/tables/normalizer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ class TRemovedTablesNormalizer::TNormalizerResult : public INormalizerChanges {
3030
return true;
3131
}
3232

33+
ui64 GetSize() const override {
34+
return PathIds.size();
35+
}
36+
3337
static std::optional<std::vector<INormalizerChanges::TPtr>> Init(NTabletFlatExecutor::TTransactionContext& txc) {
3438
using namespace NColumnShard;
3539
NIceDb::TNiceDb db(txc.DB);

ydb/core/tx/schemeshard/ut_olap/ya.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ PEERDIR(
2222
ydb/core/tx
2323
ydb/core/tx/columnshard
2424
ydb/core/tx/columnshard/test_helper
25+
ydb/core/tx/columnshard/hooks/testing
2526
ydb/core/tx/schemeshard/ut_helpers
2627
ydb/library/yql/public/udf/service/exception_policy
2728
)

0 commit comments

Comments
 (0)