aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniil Cherednik <dan.cherednik@gmail.com>2022-06-04 00:47:57 +0300
committerDaniil Cherednik <dan.cherednik@gmail.com>2022-06-04 00:47:57 +0300
commitcc561ce981af0e033a5110b0762583481bed1e74 (patch)
tree9bd154286a657a210c9b6f0fe1007ac218c16952
parent3ade208e849f6ad6c50ab70a483370133d886722 (diff)
downloadydb-cc561ce981af0e033a5110b0762583481bed1e74.tar.gz
Remove table related locks on RemoveSchema. KIKIMR-15040
ref:a4d6e15c8b3be5801463e4c31abdda462dfa898d
-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();
}