Skip to content

Commit

Permalink
Add logging for possibly deadlocks (#816) (#819)
Browse files Browse the repository at this point in the history
* Add logging for possibly deadlocks

Signed-off-by: JaySon-Huang <[email protected]>

* Address comments

Signed-off-by: JaySon-Huang <[email protected]>

* Apply suggestions from code review

Co-authored-by: JaySon-Huang <[email protected]>
Co-authored-by: JaySon <[email protected]>
  • Loading branch information
3 people authored Jun 23, 2020
1 parent edfe550 commit 8dee367
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dbms/src/Storages/DeltaMerge/DeltaMergeStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ void DeltaMergeStore::write(const Context & db_context, const DB::Settings & db_

void DeltaMergeStore::deleteRange(const Context & db_context, const DB::Settings & db_settings, const HandleRange & delete_range)
{
LOG_TRACE(log, "Write into " << db_name << "." << table_name << " delte range " << delete_range.toString());
LOG_INFO(log, "Write into " << db_name << "." << table_name << " delte range " << delete_range.toString());

EventRecorder write_block_recorder(ProfileEvents::DMDeleteRange, ProfileEvents::DMDeleteRangeNS);

Expand Down
1 change: 1 addition & 0 deletions dbms/src/Storages/Transaction/KVStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ void KVStore::removeRegion(const RegionID region_id, bool remove_data, RegionTab
}

region_persister.drop(region_id, region_lock);
LOG_INFO(log, "Persisted [region " << region_id << "] deleted");

region_table.removeRegion(region_id, remove_data, region_lock);

Expand Down
2 changes: 2 additions & 0 deletions dbms/src/Storages/Transaction/RegionTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ void RegionTable::removeRegion(const RegionID region_id, bool remove_data, const
table_to_optimize.insert(table_id);
tables.erase(table_id);
}
LOG_INFO(log, __FUNCTION__ << ": remove [region " << region_id << "] in RegionTable done");
}

// Sometime we don't need to remove data. e.g. remove region after region merge.
Expand All @@ -299,6 +300,7 @@ void RegionTable::removeRegion(const RegionID region_id, bool remove_data, const
// before `removeObsoleteDataInStorage` is done. (by param `RegionTaskLock`)
// And this is expected not to block for long time.
removeObsoleteDataInStorage(context, table_id, handle_range);
LOG_INFO(log, __FUNCTION__ << ": remove region [" << region_id << "] in storage done");
}
}

Expand Down

0 comments on commit 8dee367

Please sign in to comment.