Skip to content

Commit

Permalink
Fix shutdown bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
small-turtle-1 committed Dec 13, 2024
1 parent 76d4bde commit 0040f1c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion python/restart_test/infinity_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def infinity_runner_decorator_factory(
shutdown_out: bool = False,
kill: bool = False,
terminate_timeout: int = 60,
check_kill: bool = True
):
def decorator(f):
def wrapper(*args, **kwargs):
Expand All @@ -150,7 +151,11 @@ def wrapper(*args, **kwargs):
except Exception:
if not shutdown_out:
raise
infinity_runner.uninit(kill, terminate_timeout)
try:
infinity_runner.uninit(kill, terminate_timeout)
except Exception:
if check_kill:
raise

return wrapper

Expand Down
3 changes: 2 additions & 1 deletion src/storage/storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ Status Storage::AdminToWriter() {
UnrecoverableError("Memory index tracer was initialized before.");
}
memory_index_tracer_ = MakeUnique<BGMemIndexTracer>(config_ptr_->MemIndexMemoryQuota(), new_catalog_.get(), txn_mgr_.get());
cleanup_info_tracer_ = MakeUnique<CleanupInfoTracer>();

bg_processor_->Start();

Expand Down Expand Up @@ -634,7 +635,6 @@ Status Storage::SetStorageMode(StorageMode target_mode) {
LOG_WARN(fmt::format("Set unchanged mode"));
return Status::OK();
}
cleanup_info_tracer_ = MakeUnique<CleanupInfoTracer>();
switch (current_mode) {
case StorageMode::kUnInitialized: {
if (target_mode != StorageMode::kAdmin) {
Expand Down Expand Up @@ -732,6 +732,7 @@ Status Storage::AdminToReaderBottom(TxnTimeStamp system_start_ts) {
UnrecoverableError("Memory index tracer was initialized before.");
}
memory_index_tracer_ = MakeUnique<BGMemIndexTracer>(config_ptr_->MemIndexMemoryQuota(), new_catalog_.get(), txn_mgr_.get());
cleanup_info_tracer_ = MakeUnique<CleanupInfoTracer>();

new_catalog_->StartMemoryIndexCommit();
new_catalog_->MemIndexRecover(buffer_mgr_.get(), system_start_ts);
Expand Down

0 comments on commit 0040f1c

Please sign in to comment.