Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print table_id for table which is applying snapshot #4310

Merged
merged 8 commits into from
Mar 17, 2022
Merged
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions dbms/src/Storages/Transaction/PartitionStreams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ static void writeRegionDataToStorage(
if (region.pre_decode_cache)
{
auto schema_version = storage->getTableInfo().schema_version;
LOG_DEBUG(log, FUNCTION_NAME << ": " << region->toString() << " got pre-decode cache";
region.pre_decode_cache->toString(oss_internal_rare);
oss_internal_rare << ", storage schema version: " << schema_version);
std::stringstream ss;
region.pre_decode_cache->toString(ss);
LOG_FMT_DEBUG(log, "{}: {} got pre-decode cache {}, storage schema version: {}", FUNCTION_NAME, region->toString(), ss.str(), schema_version);

if (region.pre_decode_cache->schema_version == schema_version)
{
Expand All @@ -106,7 +106,7 @@ static void writeRegionDataToStorage(
}
else
{
LOG_DEBUG(log, FUNCTION_NAME << ": schema version not equal, try to re-decode region cache into block");
LOG_FMT_DEBUG(log, "{}: schema version not equal, try to re-decode region cache into block", FUNCTION_NAME);
region.pre_decode_cache->block.clear();
}
}
Expand Down Expand Up @@ -155,9 +155,7 @@ static void writeRegionDataToStorage(
if (need_decode)
storage->releaseDecodingBlock(block_schema_version, std::move(block_ptr));

LOG_TRACE(log,
FUNCTION_NAME << ": table " << table_id << ", region " << region->id() << ", cost [region decode " << region_decode_cost
<< ", write part " << write_part_cost << "] ms");
LOG_FMT_TRACE(log, "{}: table {}, region {}, cost [region decode {}, write part {}] ms", FUNCTION_NAME, table_id, region->id(), region_decode_cost, write_part_cost);
return true;
};

Expand Down Expand Up @@ -470,8 +468,9 @@ RegionPtrWithBlock::CachePtr GenRegionPreDecodeBlockData(const RegionPtr & regio
if (e.code() == ErrorCodes::ILLFORMAT_RAFT_ROW)
{
// br or lighting may write illegal data into tikv, skip pre-decode and ingest sst later.
LOG_WARNING(&Poco::Logger::get(__PRETTY_FUNCTION__),
"Got error while reading region committed cache: " << e.displayText() << ". Skip pre-decode and keep original cache.");
LOG_FMT_WARNING(&Poco::Logger::get(__PRETTY_FUNCTION__),
"Got error while reading region committed cache: {}. Skip pre-decode and keep original cache.",
e.displayText());
// set data_list_read and let apply snapshot process use empty block
data_list_read = RegionDataReadInfoList();
}
Expand Down Expand Up @@ -547,6 +546,7 @@ AtomicGetStorageSchema(const RegionPtr & region, TMTContext & tmt)
DecodingStorageSchemaSnapshotConstPtr schema_snapshot;

auto table_id = region->getMappedTableID();
LOG_FMT_DEBUG(&Poco::Logger::get(__PRETTY_FUNCTION__), "Get schema for table {}", table_id);
auto context = tmt.getContext();
const auto atomic_get = [&](bool force_decode) -> bool {
auto storage = tmt.getStorages().get(table_id);
Expand Down