Commit 73fe371
authored
[fix](compaction) Fix wrong JSON value used for tablet IDs in compaction status (#59236)
### What problem does this PR solve?
Related PR: #53557
Problem Summary:
```
thrift error, reason=THRIFT_EAGAIN (timed out)doris_be: /var/local/thirdparty/installed/include/rapidjson/document.h:1368: GenericValue<Encoding, Allocator> &rapidjson::GenericValue<rapidjson::UTF8<>>::AddMember(GenericValue<Encoding, Allocator> &, GenericValue<Encoding, Allocator> &, Allocator &) [Encoding = rapidjson::UTF8<>, Allocator = rapidjson::MemoryPoolAllocator<>]: Assertion `name.IsString()' failed.
13:43:12 *** Query id: 0-0 ***
13:43:12 *** is nereids: 0 ***
13:43:12 *** tablet id: 0 ***
13:43:12 *** Aborted at 1766294113 (unix time) try "date -d @1766294113" if you are using GNU date ***
13:43:12 *** Current BE git commitID: fa1f86a ***
13:43:12 *** SIGABRT unknown detail explain (@0x9b02) received by PID 39682 (TID 42141 OR 0x7b271cc0d700) from PID 39682; stack trace: ***
13:43:12 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /root/doris/be/src/common/signal_handler.h:420
13:43:12 1# 0x00007F305D563420 in /lib/x86_64-linux-gnu/libpthread.so.0
13:43:12 2# raise at ../sysdeps/unix/sysv/linux/raise.c:51
13:43:12 3# abort at /build/glibc-SzIz7B/glibc-2.31/stdlib/abort.c:81
13:43:12 4# _nl_load_domain at /build/glibc-SzIz7B/glibc-2.31/intl/loadmsgcat.c:970
13:43:12 5# 0x00007F305D37EFD6 in /lib/x86_64-linux-gnu/libc.so.6
13:43:12 6# 0x000055C98F386B8A in /mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be
13:43:12 7# doris::CompactionSubmitRegistry::jsonfy_compaction_status(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)::$_0::operator()(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<doris::DataDir*, std::unordered_set<std::shared_ptr<doris::Tablet>, std::hash<std::shared_ptr<doris::Tablet> >, std::equal_to<std::shared_ptr<doris::Tablet> >, std::allocator<std::shared_ptr<doris::Tablet> > >, std::less<doris::DataDir*>, std::allocator<std::pair<doris::DataDir* const, std::unordered_set<std::shared_ptr<doris::Tablet>, std::hash<std::shared_ptr<doris::Tablet> >, std::equal_to<std::shared_ptr<doris::Tablet> >, std::allocator<std::shared_ptr<doris::Tablet> > > > > > const&) const at /root/doris/be/src/olap/storage_engine.cpp:189
13:43:12 8# doris::CompactionSubmitRegistry::jsonfy_compaction_status(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) at /root/doris/be/src/olap/storage_engine.cpp:192
13:43:12 9# doris::CompactionAction::_handle_run_status_compaction(doris::HttpRequest*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) at /root/doris/be/src/http/action/compaction_action.cpp:225
13:43:12 10# doris::CompactionAction::handle(doris::HttpRequest*) at /root/doris/be/src/http/action/compaction_action.cpp:385
13:43:12 11# 0x000055C9AC3CFEC7 in /mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be
13:43:12 12# bufferevent_run_readcb_ at /home/runner/work/doris-thirdparty/doris-thirdparty/thirdparty/src/doris-thirdparty-libevent-2.1.12.1/bufferevent.c:252
13:43:12 13# bufferevent_readcb at /home/runner/work/doris-thirdparty/doris-thirdparty/thirdparty/src/doris-thirdparty-libevent-2.1.12.1/bufferevent_sock.c:227
13:43:12 14# event_process_active_single_queue at /home/runner/work/doris-thirdparty/doris-thirdparty/thirdparty/src/doris-thirdparty-libevent-2.1.12.1/event.c:1682
13:43:12 15# event_process_active at /home/runner/work/doris-thirdparty/doris-thirdparty/thirdparty/src/doris-thirdparty-libevent-2.1.12.1/event.c:1788
13:43:12 16# event_base_loop.constprop.0 at /home/runner/work/doris-thirdparty/doris-thirdparty/thirdparty/src/doris-thirdparty-libevent-2.1.12.1/event.c:2006
13:43:12 17# std::_Function_handler<void (), doris::EvHttpServer::start()::$_0>::_M_invoke(std::_Any_data const&) at /usr/local/ldb-toolchain-v0.26/bin/../lib/gcc/x86_64-pc-linux-gnu/15/include/g++-v15/bits/std_function.h:292
13:43:12 18# doris::ThreadPool::dispatch_thread() at /root/doris/be/src/util/threadpool.cpp:623
13:43:12 19# doris::Thread::supervise_thread(void*) at /root/doris/be/src/util/thread.cpp:461
13:43:12 20# asan_thread_start(void*) in /mnt/ssd01/pipline/OpenSourceDoris/clusterEnv/P0/Cluster0/be/lib/doris_be
13:43:12 21# start_thread at /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:478
```
Fix incorrect JSON value used for tablet IDs in compaction status
The compaction status JSON builder mistakenly pushed the compaction name
Value into the tablet ID array instead of using the tablet ID itself.
This resulted in incorrect JSON output and could trigger RapidJSON
assertions when the moved Value was later reused as an object key.
Fix the logic by:
- Using tablet ID as the array element instead of the compaction name
- Ensuring each rapidjson::Value is used only for its intended purpose
- Cleaning up JSON construction to avoid reusing moved values
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [x] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [x] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [x] No.
- [ ] Yes. <!-- Add document PR link here. eg:
apache/doris-website#1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR
should merge into -->1 parent 0391e1c commit 73fe371
1 file changed
+10
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
| |||
177 | 178 | | |
178 | 179 | | |
179 | 180 | | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
185 | 187 | | |
186 | 188 | | |
187 | 189 | | |
188 | | - | |
| 190 | + | |
189 | 191 | | |
190 | 192 | | |
191 | 193 | | |
| |||
0 commit comments