This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 2e6f9ecf35c branch-4.0: [fix](compaction) Fix wrong JSON value used 
for tablet IDs in compaction status #59236 (#59420)
2e6f9ecf35c is described below

commit 2e6f9ecf35cc9b74ba7fd11989a326ee18ae6718
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Dec 29 10:18:18 2025 +0800

    branch-4.0: [fix](compaction) Fix wrong JSON value used for tablet IDs in 
compaction status #59236 (#59420)
    
    Cherry-picked from #59236
    
    Co-authored-by: Siyang Tang <[email protected]>
---
 be/src/olap/storage_engine.cpp | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/be/src/olap/storage_engine.cpp b/be/src/olap/storage_engine.cpp
index 8c80b79fdd8..69f58c4c9e0 100644
--- a/be/src/olap/storage_engine.cpp
+++ b/be/src/olap/storage_engine.cpp
@@ -164,8 +164,9 @@ void 
CompactionSubmitRegistry::jsonfy_compaction_status(std::string* result) {
     root.SetObject();
 
     auto add_node = [&root](const std::string& name, const Registry& registry) 
{
-        rapidjson::Value key;
-        key.SetString(name.c_str(), cast_set<uint32_t>(name.length()), 
root.GetAllocator());
+        rapidjson::Value compaction_name;
+        compaction_name.SetString(name.c_str(), 
cast_set<uint32_t>(name.length()),
+                                  root.GetAllocator());
         rapidjson::Document path_obj;
         path_obj.SetObject();
         for (const auto& it : registry) {
@@ -177,15 +178,16 @@ void 
CompactionSubmitRegistry::jsonfy_compaction_status(std::string* result) {
             arr.SetArray();
 
             for (const auto& tablet : it.second) {
-                rapidjson::Value temp_key;
-                auto key_str = std::to_string(tablet->tablet_id());
-                temp_key.SetString(key_str.c_str(), 
cast_set<uint32_t>(key_str.length()),
-                                   root.GetAllocator());
-                arr.PushBack(key, root.GetAllocator());
+                rapidjson::Value tablet_id;
+                auto tablet_id_str = std::to_string(tablet->tablet_id());
+                tablet_id.SetString(tablet_id_str.c_str(),
+                                    cast_set<uint32_t>(tablet_id_str.length()),
+                                    root.GetAllocator());
+                arr.PushBack(tablet_id, root.GetAllocator());
             }
             path_obj.AddMember(path_key, arr, root.GetAllocator());
         }
-        root.AddMember(key, path_obj, root.GetAllocator());
+        root.AddMember(compaction_name, path_obj, root.GetAllocator());
     };
 
     std::unique_lock<std::mutex> l(_tablet_submitted_compaction_mutex);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to