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

Ignore frozen_metadata.txt while traversing shadow directory from system.remote_data_paths #70590

Merged
merged 5 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion docs/en/operations/settings/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -9376,7 +9376,7 @@ Type: Bool

Default value: 0

Traverse shadow directory when query system.remote_data_paths
Traverse frozen data(shadow directory) in addition to actual table data when query system.remote_data_paths
aalexfvk marked this conversation as resolved.
Show resolved Hide resolved

## union_default_mode {#union_default_mode}

Expand Down
2 changes: 1 addition & 1 deletion src/Core/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5375,7 +5375,7 @@ SELECT * FROM TAB ORDER BY ALL SETTINGS enable_order_by_all = 0;
If enabled, server will ignore all DROP table queries with specified probability (for Memory and JOIN engines it will replcase DROP to TRUNCATE). Used for testing purposes
)", 0) \
M(Bool, traverse_shadow_remote_data_paths, false, R"(
Traverse shadow directory when query system.remote_data_paths
Traverse frozen data(shadow directory) in addition to actual table data when query system.remote_data_paths
aalexfvk marked this conversation as resolved.
Show resolved Hide resolved
)", 0) \
M(Bool, geo_distance_returns_float64_on_float64_arguments, true, R"(
If all four arguments to `geoDistance`, `greatCircleDistance`, `greatCircleAngle` functions are Float64, return Float64 and use double precision for internal calculations. In previous ClickHouse versions, the functions always returned Float32.
Expand Down
6 changes: 4 additions & 2 deletions src/Storages/System/StorageSystemRemoteDataPaths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@ class SystemRemoteDataPathsSource : public ISource
static bool skipPredicateForShadowDir(const String & local_path)
{
// `shadow/{backup_name}/revision.txt` is not an object metadata file
// `shadow/../{part_name}/frozen_metadata.txt` is not an object metadata file
const auto path = fs::path(local_path);
return path.filename() == "revision.txt" &&
return (path.filename() == "revision.txt" &&
path.parent_path().has_parent_path() &&
path.parent_path().parent_path().filename() == "shadow";
path.parent_path().parent_path().filename() == "shadow") ||
path.filename() == "frozen_metadata.txt";
}

const UInt64 max_block_size;
Expand Down
Loading