Skip to content

Commit 982289e

Browse files
authored
Merge e0bd50a into 8a267cb
2 parents 8a267cb + e0bd50a commit 982289e

File tree

5 files changed

+31
-19
lines changed

5 files changed

+31
-19
lines changed

ydb/core/base/table_index.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,4 +201,24 @@ TClusterId SetPostingParentFlag(TClusterId parent) {
201201
return (parent | PostingParentFlag);
202202
}
203203

204+
TString ToShortDebugString(const NKikimrTxDataShard::TEvReshuffleKMeansRequest& record) {
205+
auto copy = record;
206+
TStringBuilder result;
207+
// clusters are not human readable and can be large like 100Kb+
208+
result << " Clusters: " << record.ClustersSize();
209+
copy.ClearClusters();
210+
result << " " << copy.ShortDebugString();
211+
return result;
212+
}
213+
214+
TString ToShortDebugString(const NKikimrTxDataShard::TEvSampleKResponse& record) {
215+
auto copy = record;
216+
TStringBuilder result;
217+
// rows are not human readable and can be large like 100Kb+
218+
result << " Rows: " << record.RowsSize();
219+
copy.ClearRows();
220+
result << " " << copy.ShortDebugString();
221+
return result;
222+
}
223+
204224
}

ydb/core/base/table_index.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <ydb/public/api/protos/ydb_value.pb.h>
44
#include <ydb/public/lib/scheme_types/scheme_type_id.h>
55
#include <ydb/core/protos/flat_scheme_op.pb.h>
6+
#include <ydb/core/protos/tx_datashard.pb.h>
67

78
#include <util/generic/hash_set.h>
89
#include <util/generic/vector.h>
@@ -45,5 +46,8 @@ void EnsureNoPostingParentFlag(TClusterId parent);
4546

4647
TClusterId SetPostingParentFlag(TClusterId parent);
4748

49+
TString ToShortDebugString(const NKikimrTxDataShard::TEvReshuffleKMeansRequest& record);
50+
TString ToShortDebugString(const NKikimrTxDataShard::TEvSampleKResponse& record);
51+
4852
}
4953
}

ydb/core/tx/datashard/build_index/reshuffle_kmeans.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ void TDataShard::HandleSafe(TEvDataShard::TEvReshuffleKMeansRequest::TPtr& ev, c
378378
response->Record.SetRequestSeqNoRound(seqNo.Round);
379379

380380
LOG_N("Starting TReshuffleKMeansScan TabletId: " << TabletID()
381-
<< " " << request.ShortDebugString()
381+
<< " " << NTableIndex::ToShortDebugString(request)
382382
<< " row version " << rowVersion);
383383

384384
// Note: it's very unlikely that we have volatile txs before this snapshot
@@ -396,7 +396,7 @@ void TDataShard::HandleSafe(TEvDataShard::TEvReshuffleKMeansRequest::TPtr& ev, c
396396
auto trySendBadRequest = [&] {
397397
if (response->Record.GetStatus() == NKikimrIndexBuilder::EBuildStatus::BAD_REQUEST) {
398398
LOG_E("Rejecting TReshuffleKMeansScan bad request TabletId: " << TabletID()
399-
<< " " << request.ShortDebugString()
399+
<< " " << NTableIndex::ToShortDebugString(request)
400400
<< " with response " << response->Record.ShortDebugString());
401401
ctx.Send(ev->Sender, std::move(response));
402402
return true;

ydb/core/tx/datashard/build_index/sample_k.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ class TSampleKScan final: public TActor<TSampleKScan>, public IActorExceptionHan
169169
NYql::IssuesToMessage(Issues, record.MutableIssues());
170170

171171
if (Response->Record.GetStatus() == NKikimrIndexBuilder::DONE) {
172-
LOG_N("Done " << Debug() << " " << Response->Record.ShortDebugString());
172+
LOG_N("Done " << Debug() << " " << NTableIndex::ToShortDebugString(Response->Record));
173173
} else {
174-
LOG_E("Failed " << Debug() << " " << Response->Record.ShortDebugString());
174+
LOG_E("Failed " << Debug() << " " << NTableIndex::ToShortDebugString(Response->Record));
175175
}
176176
Send(ResponseActorId, Response.Release());
177177

@@ -279,7 +279,7 @@ void TDataShard::HandleSafe(TEvDataShard::TEvSampleKRequest::TPtr& ev, const TAc
279279
if (response->Record.GetStatus() == NKikimrIndexBuilder::EBuildStatus::BAD_REQUEST) {
280280
LOG_E("Rejecting TSampleKScan bad request TabletId: " << TabletID()
281281
<< " " << request.ShortDebugString()
282-
<< " with response " << response->Record.ShortDebugString());
282+
<< " with response " << NTableIndex::ToShortDebugString(response->Record));
283283
ctx.Send(ev->Sender, std::move(response));
284284
return true;
285285
} else {

ydb/core/tx/schemeshard/schemeshard_build_index__progress.cpp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -605,13 +605,7 @@ struct TSchemeShard::TIndexBuilder::TTxProgress: public TSchemeShard::TIndexBuil
605605
};
606606

607607
auto shardId = CommonFillRecord(ev->Record, shardIdx, buildInfo);
608-
[[maybe_unused]] auto toDebugStr = [&](const NKikimrTxDataShard::TEvReshuffleKMeansRequest& record) {
609-
auto r = record;
610-
// clusters are not human readable and can be large like 100Kb+
611-
r.ClearClusters();
612-
return r.ShortDebugString();
613-
};
614-
LOG_N("TTxBuildProgress: TEvReshuffleKMeansRequest: " << toDebugStr(ev->Record));
608+
LOG_N("TTxBuildProgress: TEvReshuffleKMeansRequest: " << ToShortDebugString(ev->Record));
615609

616610
ToTabletSend.emplace(shardId, std::move(ev));
617611
}
@@ -1566,15 +1560,9 @@ struct TSchemeShard::TIndexBuilder::TTxReplySampleK: public TSchemeShard::TIndex
15661560
return true;
15671561
}
15681562
auto& buildInfo = *buildInfoPtr->Get();
1569-
[[maybe_unused]] auto toDebugStr = [&](const NKikimrTxDataShard::TEvSampleKResponse& record) {
1570-
auto r = record;
1571-
// rows are not human readable and can be large like 100Kb+
1572-
r.ClearRows();
1573-
return r.ShortDebugString();
1574-
};
15751563
LOG_D("TTxReply : TEvSampleKResponse"
15761564
<< ", TIndexBuildInfo: " << buildInfo
1577-
<< ", record: " << toDebugStr(record));
1565+
<< ", record: " << ToShortDebugString(record));
15781566

15791567
TTabletId shardId = TTabletId(record.GetTabletId());
15801568
if (!Self->TabletIdToShardIdx.contains(shardId)) {

0 commit comments

Comments
 (0)