aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniil Cherednik <dcherednik@yandex-team.ru>2022-06-06 16:47:13 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-06-06 16:47:13 +0300
commit935d02f1a6e32dbadfa5f1a56304260a23aa7d7f (patch)
tree35bbba843cd832210526061cf3115569b4d99c9a
parent614990fcbe2cb95637e3aeecc2467ae30a73b54d (diff)
downloadydb-935d02f1a6e32dbadfa5f1a56304260a23aa7d7f.tar.gz
Remove table related locks on RemoveSchema. KIKIMR-15040
REVIEW: 2609042 REVIEW: 2612259 x-ydb-stable-ref: d4536fd0281400884d657736a6145d6807cb4b9c
-rw-r--r--ydb/core/tx/datashard/datashard_locks.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/ydb/core/tx/datashard/datashard_locks.cpp b/ydb/core/tx/datashard/datashard_locks.cpp
index aa5fc3876b..ba5de5a9a6 100644
--- a/ydb/core/tx/datashard/datashard_locks.cpp
+++ b/ydb/core/tx/datashard/datashard_locks.cpp
@@ -115,7 +115,7 @@ TLockInfo::TPtr TLockLocker::AddShardLock(ui64 lockTxId, const THashSet<TPathId>
ShardLocks.insert(lockTxId);
for (const TPathId& tableId : lock->GetAffectedTables()) {
- Tables[tableId]->RemoveLock(lock);
+ Tables.at(tableId)->RemoveLock(lock);
}
lock->AddShardLock(affectedTables);
return lock;
@@ -187,7 +187,7 @@ void TLockLocker::RemoveBrokenRanges() {
if (!lock->IsShardLock()) {
for (const TPathId& tableId : lock->GetAffectedTables()) {
- Tables[tableId]->RemoveLock(lock);
+ Tables.at(tableId)->RemoveLock(lock);
}
} else {
ShardLocks.erase(lockId);
@@ -214,7 +214,7 @@ void TLockLocker::RemoveBrokenRanges() {
if (!lock->IsShardLock()) {
for (const TPathId& tableId : lock->GetAffectedTables()) {
- Tables[tableId]->RemoveLock(lock);
+ Tables.at(tableId)->RemoveLock(lock);
}
} else {
ShardLocks.erase(lockId);
@@ -249,7 +249,7 @@ void TLockLocker::RemoveOneLock(ui64 lockTxId) {
if (!txLock->IsShardLock()) {
for (const TPathId& tableId : txLock->GetAffectedTables()) {
- Tables[tableId]->RemoveLock(txLock);
+ Tables.at(tableId)->RemoveLock(txLock);
}
} else {
ShardLocks.erase(lockTxId);
@@ -296,6 +296,13 @@ void TLockLocker::UpdateSchema(const TPathId& tableId, const TUserTable& tableIn
void TLockLocker::RemoveSchema(const TPathId& tableId) {
Tables.erase(tableId);
+ Y_VERIFY(Tables.empty());
+ Locks.clear();
+ ShardLocks.clear();
+ BrokenLocks.clear();
+ CleanupPending.clear();
+ BrokenCandidates.clear();
+ CleanupCandidates.clear();
}