This is an automated email from the ASF dual-hosted git repository.
gavinchou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new d130d3b99c9 [fix](cloud) Separate HTTP encoding for job recycle and
check keys (#67243)
d130d3b99c9 is described below
commit d130d3b99c90e72015bdff118508608fcd29e09c
Author: Yixuan Wang <[email protected]>
AuthorDate: Fri Aug 28 14:34:11 2026 +0800
[fix](cloud) Separate HTTP encoding for job recycle and check keys (#67243)
Problem Summary:
The HTTP key encoder incorrectly mapped JobRecycleKey to job_check_key,
causing recycle job keys to use the check namespace. This change maps
JobRecycleKey to job_recycle_key, adds the JobCheckKey HTTP mapping, and
provides the string-returning overload for job_recycle_key. Unit test
coverage was added for both key types.
---
cloud/src/meta-service/http_encode_key.cpp | 3 ++-
cloud/src/meta-store/keys.h | 1 +
cloud/test/http_encode_key_test.cpp | 12 ++++++++++++
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/cloud/src/meta-service/http_encode_key.cpp
b/cloud/src/meta-service/http_encode_key.cpp
index 3b985b28f8f..bab0864db39 100644
--- a/cloud/src/meta-service/http_encode_key.cpp
+++ b/cloud/src/meta-service/http_encode_key.cpp
@@ -266,7 +266,8 @@ static std::unordered_map<std::string_view,
{"CopyJobKey", {{"instance_id", "stage_id", "table_id",
"copy_id", "group_id"}, [](param_type& p) { return
copy_job_key(KeyInfoSetter<CopyJobKeyInfo>{p}.get());
}, parse<CopyJobPB> , parse_json<CopyJobPB>}},
{"CopyFileKey", {{"instance_id", "stage_id", "table_id",
"obj_key", "obj_etag"}, [](param_type& p) { return
copy_file_key(KeyInfoSetter<CopyFileKeyInfo>{p}.get());
}, parse<CopyFilePB> , parse_json<CopyFilePB>}},
{"RecycleStageKey", {{"instance_id", "stage_id"},
[](param_type& p) { return
recycle_stage_key(KeyInfoSetter<RecycleStageKeyInfo>{p}.get());
}, parse<RecycleStagePB> , parse_json<RecycleStagePB>}},
- {"JobRecycleKey", {{"instance_id"},
[](param_type& p) { return
job_check_key(KeyInfoSetter<JobRecycleKeyInfo>{p}.get());
}, parse<JobRecyclePB> , parse_json<JobRecyclePB>}},
+ {"JobRecycleKey", {{"instance_id"},
[](param_type& p) { return
job_recycle_key(KeyInfoSetter<JobRecycleKeyInfo>{p}.get());
}, parse<JobRecyclePB> , parse_json<JobRecyclePB>}},
+ {"JobCheckKey", {{"instance_id"},
[](param_type& p) { return
job_check_key(KeyInfoSetter<JobRecycleKeyInfo>{p}.get());
}, parse<JobRecyclePB> , parse_json<JobRecyclePB>}},
{"MetaSchemaKey", {{"instance_id", "index_id",
"schema_version"}, [](param_type& p) { return
meta_schema_key(KeyInfoSetter<MetaSchemaKeyInfo>{p}.get());
}, parse_tablet_schema ,
parse_json<doris::TabletSchemaCloudPB>}},
{"MetaDeleteBitmap", {{"instance_id", "tablet_id", "rowest_id",
"version", "seg_id"}, [](param_type& p) { return
meta_delete_bitmap_key(KeyInfoSetter<MetaDeleteBitmapInfo>{p}.get());
}, parse_delete_bitmap , parse_json<DeleteBitmapPB>}},
{"MetaDeleteBitmapUpdateLock", {{"instance_id", "table_id",
"partition_id"}, [](param_type& p) { return
meta_delete_bitmap_update_lock_key(KeyInfoSetter<MetaDeleteBitmapUpdateLockInfo>{p}.get());
}, parse<DeleteBitmapUpdateLockPB> , parse_json<DeleteBitmapUpdateLockPB>}},
diff --git a/cloud/src/meta-store/keys.h b/cloud/src/meta-store/keys.h
index d0253629f21..c1142f62a08 100644
--- a/cloud/src/meta-store/keys.h
+++ b/cloud/src/meta-store/keys.h
@@ -446,6 +446,7 @@ void job_check_key(const JobRecycleKeyInfo& in,
std::string* out);
void job_snapshot_data_migrator_key(const JobSnapshotDataMigratorKeyInfo& in,
std::string* out);
void job_snapshot_chain_compactor_key(const JobSnapshotChainCompactorKeyInfo&
in, std::string* out);
static inline std::string job_check_key(const JobRecycleKeyInfo& in) {
std::string s; job_check_key(in, &s); return s; }
+static inline std::string job_recycle_key(const JobRecycleKeyInfo& in) {
std::string s; job_recycle_key(in, &s); return s; }
static inline std::string job_snapshot_data_migrator_key(const
JobSnapshotDataMigratorKeyInfo& in) { std::string s;
job_snapshot_data_migrator_key(in, &s); return s; }
static inline std::string job_snapshot_chain_compactor_key(const
JobSnapshotChainCompactorKeyInfo& in) { std::string s;
job_snapshot_chain_compactor_key(in, &s); return s; }
void job_tablet_key(const JobTabletKeyInfo& in, std::string* out);
diff --git a/cloud/test/http_encode_key_test.cpp
b/cloud/test/http_encode_key_test.cpp
index 95c5477abc0..bb0bcb58f5a 100644
--- a/cloud/test/http_encode_key_test.cpp
+++ b/cloud/test/http_encode_key_test.cpp
@@ -476,6 +476,18 @@ merged_stats:
{"idx":{"table_id":"10086","index_id":"100010","partition_id":"100
Input {
"JobRecycleKey",
"instance_id=gavin-instance",
+
{"01106a6f62000110676176696e2d696e7374616e636500011072656379636c650001"},
+ []() -> std::vector<std::string> {
+ JobRecyclePB pb;
+ pb.set_instance_id("gavin-instance");
+ pb.set_ip_port("host_1");
+ return {pb.SerializeAsString()};
+ },
+ R"({"instance_id":"gavin-instance","ip_port":"host_1"})",
+ },
+ Input {
+ "JobCheckKey",
+ "instance_id=gavin-instance",
{"01106a6f62000110676176696e2d696e7374616e6365000110636865636b0001"},
[]() -> std::vector<std::string> {
JobRecyclePB pb;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]