Skip to content

Commit

Permalink
Disagg: Add nullptr check on S3LockLocalManager (pingcap#9387) (pin…
Browse files Browse the repository at this point in the history
…gcap#282)

Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
  • Loading branch information
CalvinNeo and ti-chi-bot[bot] authored Sep 3, 2024
1 parent 66c6e9c commit e9c8366
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions dbms/src/Flash/Disaggregated/S3LockClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ String S3LockClient::updateOwnerAddr(const Timepoint & deadline, const LoggerPtr
using namespace std::chrono_literals;
while (true)
{
RUNTIME_CHECK(s3gc_owner != nullptr);
auto owner_info = s3gc_owner->getOwnerID();
switch (owner_info.status)
{
Expand Down
6 changes: 6 additions & 0 deletions dbms/src/Storages/Page/V3/Universal/S3LockLocalManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ std::optional<CheckpointProto::ManifestFilePrefix> S3LockLocalManager::initStore
}

s3lock_client = std::move(s3lock_client_);
if unlikely (s3lock_client == nullptr)
{
LOG_INFO(log, "S3 lock manager has null s3lock client");
}

store_id = actual_store_id;

LOG_INFO(
Expand Down Expand Up @@ -223,6 +228,7 @@ String S3LockLocalManager::createS3Lock(
}
else
{
RUNTIME_CHECK_MSG(s3lock_client, "S3 Lock Client is not initialized");
// Try to create a lock file for the data file created by another store.
// e.g. Ingest some pages from CheckpointDataFile or DTFile when doing FAP,
// send rpc to S3LockService
Expand Down

0 comments on commit e9c8366

Please sign in to comment.