Skip to content

Commit 606191b

Browse files
authored
Merge 54aa50f into b0faf7e
2 parents b0faf7e + 54aa50f commit 606191b

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

ydb/core/blobstorage/pdisk/blobstorage_pdisk_impl_log.cpp

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,28 @@ bool TPDisk::ProcessChunk0(const NPDisk::TEvReadLogResult &readLogResult, TStrin
466466
return true;
467467
}
468468

469+
static void PrintCondensedChunksList(TStringStream& str, const std::vector<ui32>& chunks) {
470+
str << " [";
471+
bool first = true;
472+
std::optional<TChunkIdx> begin;
473+
for (size_t i = 0; i < chunks.size(); ++i) {
474+
if (!begin) {
475+
begin = chunks[i];
476+
}
477+
if (i + 1 < chunks.size() && chunks[i] + 1 == chunks[i + 1]) {
478+
continue;
479+
}
480+
str << (std::exchange(first, false) ? "" : " ");
481+
if (*begin == chunks[i]) {
482+
str << chunks[i];
483+
} else {
484+
str << *begin << "-" << chunks[i];
485+
}
486+
begin.reset();
487+
}
488+
str << "];";
489+
}
490+
469491
void TPDisk::PrintChunksDebugInfo() {
470492
auto print = [&] () {
471493
std::map<TOwner, std::vector<ui32>> ownerToChunks;
@@ -479,17 +501,13 @@ void TPDisk::PrintChunksDebugInfo() {
479501
str << "PDiskId# " << PDiskId << " PrintChunksDebugInfo; ";
480502
for (auto& [owner, chunks] : ownerToChunks) {
481503
std::sort(chunks.begin(), chunks.end());
482-
str << " Owner# " << owner << " [";
483-
bool first = true;
484-
for (auto idx : chunks) {
485-
str << (std::exchange(first, false) ? "" : " ") << idx;
486-
}
487-
str << "];";
504+
str << " Owner# " << owner;
505+
PrintCondensedChunksList(str, chunks);
488506
}
489507
return str.Str();
490508
};
491509

492-
LOG_INFO_S(*ActorSystem, NKikimrServices::BS_PDISK, print());
510+
LOG_DEBUG_S(*ActorSystem, NKikimrServices::BS_PDISK, print());
493511
}
494512

495513
TRcBuf TPDisk::ProcessReadSysLogResult(ui64 &outWritePosition, ui64 &outLsn,

0 commit comments

Comments
 (0)