forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 19
Plain merge tree partition exports #2290
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
Open
arthurpassos
wants to merge
39
commits into
antalya-26.6
Choose a base branch
from
feature/antalya-26.6/export-partition-plain-merge-tree
base: antalya-26.6
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
69f071a
1st vibe coded version
arthurpassos 3190603
some vibe coded fixes
arthurpassos d94ea53
persist-then-apply and uuidv4 instead of snowflakeid
arthurpassos b2af06c
idk
arthurpassos f2ee03f
possibly fix build
arthurpassos 240da81
chmod
arthurpassos 9ff4a4a
fix kill operation
arthurpassos 6c86d2f
fix backoff on plain
arthurpassos a622f44
make code a bit more readable, ai
arthurpassos 23d90fa
release parts
arthurpassos fe7e61a
fix endless commit due to part ref lost
arthurpassos 7c959fb
well, I don't like it, but ok
arthurpassos f06a7dd
fix dispatch err handling
arthurpassos 7482d6b
fix
arthurpassos c8d038d
Merge remote-tracking branch 'origin/antalya-26.6' into feature/antal…
arthurpassos 875cc47
throw exceptions to the user
arthurpassos 9496d85
throw on unknown values
arthurpassos 3af519a
simpĺify docs
arthurpassos 31b04b1
throw on exporting unreadable entries
arthurpassos 01b5d38
Merge branch 'antalya-26.6' into feature/antalya-26.6/export-partitio…
arthurpassos a0badb4
unify tables
arthurpassos 2eab452
fix old bug
arthurpassos cd502a6
add no-cas
arthurpassos 3fc5e5f
rmv unnecessary tests
arthurpassos cae460a
fix long standing issue with key
arthurpassos d4a3859
unify replicated and plain export tests
arthurpassos b50cee3
Merge branch 'antalya-26.6' into feature/antalya-26.6/export-partitio…
arthurpassos b89bfa1
fix few bugs
arthurpassos 00b1540
improve testing suite
arthurpassos f93a925
Merge branch 'antalya-26.6' into feature/antalya-26.6/export-partitio…
arthurpassos 487b674
Merge branch 'antalya-26.6' into feature/antalya-26.6/export-partitio…
arthurpassos 0433384
some documentation fixes
arthurpassos b9f4406
fix some more docs
arthurpassos ff54cf5
improve naming
arthurpassos 7a8b440
more comments docs
arthurpassos 968163b
rename method
arthurpassos 8ef5a76
documentation
arthurpassos c70028c
ai fixes
arthurpassos 2662683
persist commit info plain mt
arthurpassos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| #pragma once | ||
|
|
||
| #include <sstream> | ||
| #include <base/types.h> | ||
| #include <Poco/JSON/Object.h> | ||
| #include <Poco/JSON/Parser.h> | ||
|
|
||
| namespace DB | ||
| { | ||
|
|
||
| /// Paths reported by the destination storage when a partition export commit lands. | ||
| /// | ||
| /// Recorded exactly once, atomically with the task's transition to COMPLETED: | ||
| /// - `Replicated*MergeTree` writes it to <export-entry>/commit_info | ||
| /// (see ExportPartitionUtils::commit), | ||
| /// - plain `MergeTree` embeds it in the on-disk task descriptor | ||
| /// (see MergeTreePartitionExportScheduler::tryCommit). | ||
| /// | ||
| /// All Iceberg fields are empty for non-Iceberg destinations. They may also be | ||
| /// empty for an Iceberg destination if the committing node crashed between | ||
| /// writing the object-storage files and recording this entry; in that case the | ||
| /// task still reaches COMPLETED through the recovery path but the commit info | ||
| /// remains absent. This is best-effort observability and acceptable. | ||
| struct ExportPartitionCommitInfoEntry | ||
| { | ||
| /// Iceberg: path (in destination object storage) of the new vN.metadata.json | ||
| /// written by the commit. | ||
| String iceberg_metadata_file; | ||
|
|
||
| /// Iceberg: path of the snap-<id>-<format_version>-<uuid>.avro manifest list | ||
| /// referenced by the new snapshot. | ||
| String iceberg_manifest_list; | ||
|
|
||
| /// Iceberg: path of the manifest entry file (*.avro) referenced by the | ||
| /// manifest list. | ||
| String iceberg_manifest_file; | ||
|
|
||
| /// Plain object storage: path of the commit marker file written by | ||
| /// StorageObjectStorage::commitExportPartitionTransaction. Empty for Iceberg. | ||
| String commit_marker_file; | ||
|
|
||
| Poco::JSON::Object::Ptr toJsonObject() const | ||
| { | ||
| Poco::JSON::Object::Ptr json = new Poco::JSON::Object(); | ||
| json->set("iceberg_metadata_file", iceberg_metadata_file); | ||
| json->set("iceberg_manifest_list", iceberg_manifest_list); | ||
| json->set("iceberg_manifest_file", iceberg_manifest_file); | ||
| json->set("commit_marker_file", commit_marker_file); | ||
| return json; | ||
| } | ||
|
|
||
| static ExportPartitionCommitInfoEntry fromJsonObject(const Poco::JSON::Object::Ptr & json) | ||
| { | ||
| ExportPartitionCommitInfoEntry entry; | ||
|
|
||
| if (json->has("iceberg_metadata_file")) | ||
| entry.iceberg_metadata_file = json->getValue<String>("iceberg_metadata_file"); | ||
| if (json->has("iceberg_manifest_list")) | ||
| entry.iceberg_manifest_list = json->getValue<String>("iceberg_manifest_list"); | ||
|
|
||
| if (json->has("iceberg_manifest_file")) | ||
| entry.iceberg_manifest_file = json->getValue<String>("iceberg_manifest_file"); | ||
|
|
||
| if (json->has("commit_marker_file")) | ||
| entry.commit_marker_file = json->getValue<String>("commit_marker_file"); | ||
|
|
||
| return entry; | ||
| } | ||
|
|
||
| std::string toJsonString() const | ||
| { | ||
| std::ostringstream oss; // STYLE_CHECK_ALLOW_STD_STRING_STREAM | ||
| oss.exceptions(std::ios::failbit); | ||
| toJsonObject()->stringify(oss); | ||
| return oss.str(); | ||
| } | ||
|
|
||
| static ExportPartitionCommitInfoEntry fromJsonString(const std::string & json_string) | ||
| { | ||
| if (json_string.empty()) | ||
| return {}; | ||
|
|
||
| Poco::JSON::Parser parser; | ||
| return fromJsonObject(parser.parse(json_string).extract<Poco::JSON::Object::Ptr>()); | ||
| } | ||
| }; | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should check ways around this later