Skip to content

Generate blob ids in Meta Storage - #90538

Merged
Michicosun merged 6 commits into
masterfrom
generate_blob_ids_in_meta_tx
Nov 24, 2025
Merged

Michicosun merged 6 commits into
masterfrom
generate_blob_ids_in_meta_tx

Conversation

@Michicosun

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Let's move the responsibility of blob IDs generation from object storage to metadata storage. This helps with a more custom implementation of blob tracking lifetime.

@clickhouse-gh

clickhouse-gh Bot commented Nov 20, 2025 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [6dc5fa1]

Summary: ❌

job_name test_name status info comment
Stateless tests (arm_asan, targeted) failure
00746_sql_fuzzy FAIL cidb
Stateless tests (amd_debug, AsyncInsert, s3 storage, parallel) failure
03702_alter_column_update_and_delete_with_secondary_index_rebuild FAIL cidb
Integration tests (amd_binary, 2/5) failure
test_restore_db_replica/test.py::test_restore_db_replica_with_diffrent_table_metadata[restore node1-node2] FAIL cidb, flaky
Integration tests (amd_tsan, 3/6) failure
test_restore_db_replica/test.py::test_query_after_restore_db_replica[alter table-with exists table-no restart] FAIL cidb, flaky
Stress test (amd_debug) failure
Server died FAIL cidb
Hung check failed, possible deadlock found (see hung_check.log) FAIL cidb
Killed by signal (in clickhouse-server.log) FAIL cidb
Fatal message in clickhouse-server.log (see fatal_messages.txt) FAIL cidb
Killed by signal (output files) FAIL cidb
Found signal in gdb.log FAIL cidb
BuzzHouse (amd_debug) failure
Logical error: 'Inconsistent AST formatting: the query: FAIL cidb
BuzzHouse (arm_asan) failure
Logical error: 'false && "WriteBuffer is neither finalized nor canceled in destructor."'. FAIL cidb
BuzzHouse (amd_ubsan) failure
/home/ubuntu/actions-runner/_work/ClickHouse/ClickHouse/src/IO/VarInt.h:32:5: runtime error: store to null pointer of type 'char' FAIL cidb

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Nov 20, 2025
Comment on lines +132 to +144
std::string generateObjectKeyForPath(const std::shared_ptr<IMetadataStorage> & metadata, const std::string & path)
{
auto tx = metadata->createTransaction();
return tx->generateObjectKeyForPath(path).serialize();
}

std::string createMetadataObjectPath(const std::shared_ptr<IMetadataStorage> & metadata, const std::string & directory)
{
auto tx = metadata->createTransaction();
auto file_remote_path = tx->generateObjectKeyForPath(fs::path(directory) / "file.txt").serialize();
auto object_key_prefix = fs::path(file_remote_path).parent_path().filename();
auto common_key_prefix = fs::path(file_remote_path).parent_path().parent_path();
return fs::path(common_key_prefix) / "__meta" / object_key_prefix / "prefix.path";

@Michicosun Michicosun Nov 20, 2025 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hack! It is needed to check the remote layout of real blobs in tests.

return ObjectStorageKey::createAsAbsolute(fs::path(storage_key_prefix) / remote_info->remote_path / filename);
}

std::string FlatDirectoryStructureKeyGenerator::generateForDirectory(const String & path) const

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API is not consistent with generate. It should also return the remote key starting from the storage_key_prefix, but in this case, all code in plain-rewritable operations should be rewritten.

@Michicosun
Michicosun added this pull request to the merge queue Nov 24, 2025
Merged via the queue into master with commit eb8b09b Nov 24, 2025
@Michicosun
Michicosun deleted the generate_blob_ids_in_meta_tx branch November 24, 2025 18:34
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants