Skip to content

Commit 85df583

Browse files
committed
cr use IsLocked method
1 parent 59b5938 commit 85df583

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

ydb/core/tx/schemeshard/schemeshard__table_stats.cpp

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -484,22 +484,18 @@ bool TTxStoreTableStats::PersistSingleStats(const TPathId& pathId,
484484
return true;
485485
}
486486

487-
{
488-
auto path = TPath::Init(pathId, Self);
489-
auto checks = path.Check();
490-
491-
constexpr ui64 deltaShards = 2;
492-
checks
493-
.PathShardsLimit(deltaShards)
494-
.ShardsLimit(deltaShards);
495-
496-
if (!checks) {
497-
LOG_NOTICE_S(ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
498-
"Do not request full stats from datashard"
499-
<< ", datashard: " << datashardId
500-
<< ", reason: " << checks.GetError());
501-
return true;
502-
}
487+
auto path = TPath::Init(pathId, Self);
488+
auto checks = path.Check();
489+
constexpr ui64 deltaShards = 2;
490+
checks
491+
.PathShardsLimit(deltaShards)
492+
.ShardsLimit(deltaShards);
493+
if (!checks) {
494+
LOG_NOTICE_S(ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
495+
"Do not request full stats from datashard"
496+
<< ", datashard: " << datashardId
497+
<< ", reason: " << checks.GetError());
498+
return true;
503499
}
504500

505501
if (newStats.HasBorrowedData) {
@@ -509,9 +505,9 @@ bool TTxStoreTableStats::PersistSingleStats(const TPathId& pathId,
509505
return true;
510506
}
511507

512-
if (auto lock = Self->LockedPaths.FindPtr(pathId); lock) {
508+
if (path.IsLocked()) {
513509
LOG_DEBUG_S(ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
514-
"Postpone split tablet " << datashardId << " because it is locked by " << *lock);
510+
"Postpone split tablet " << datashardId << " because it is locked by " << path.LockedBy());
515511
return true;
516512
}
517513

ydb/core/tx/schemeshard/schemeshard__table_stats_histogram.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ bool TTxPartitionHistogram::Execute(TTransactionContext& txc, const TActorContex
341341
}
342342

343343
TTableInfo::TPtr table = Self->Tables[tableId];
344+
auto path = TPath::Init(tableId, Self);
344345

345346
if (!Self->TabletIdToShardIdx.contains(datashardId)) {
346347
LOG_DEBUG_S(ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
@@ -355,9 +356,9 @@ bool TTxPartitionHistogram::Execute(TTransactionContext& txc, const TActorContex
355356
return true;
356357
}
357358

358-
if (auto lock = Self->LockedPaths.FindPtr(tableId); lock) {
359+
if (path.IsLocked()) {
359360
LOG_DEBUG_S(ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
360-
"TTxPartitionHistogram Skip locked table tablet " << datashardId << " by " << *lock);
361+
"TTxPartitionHistogram Skip locked table tablet " << datashardId << " by " << path.LockedBy());
361362
return true;
362363
}
363364

0 commit comments

Comments
 (0)