apache / doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
https://doris.apache.org
Apache License 2.0
11.82k stars 3.12k forks source link

[Fix](Scanner) Fix reinitialization of TabletReader #37059

Closed bobhan1 closed 1 day ago

bobhan1 commented 2 days ago

Proposed changes

F20240628 01:49:16.382710 4183685 delete_handler.cpp:388] Check failed: !_is_inited reinitialize delete handler.
*** Check failure stack trace: ***
    @     0x55700470e3c6  google::LogMessage::SendToLog()
    @     0x55700470ae10  google::LogMessage::Flush()
    @     0x55700470ec09  google::LogMessageFatal::~LogMessageFatal()
    @     0x556fccf40e64  doris::DeleteHandler::init()
    @     0x556fcff46678  doris::TabletReader::_init_delete_condition()
    @     0x556fcff3a2dd  doris::TabletReader::_init_params()
    @     0x556fcff39432  doris::TabletReader::init()
    @     0x556fffb8c2dd  doris::vectorized::BlockReader::init()
    @     0x557002cca96a  doris::vectorized::NewOlapScanner::open()
    @     0x556fe892d565  doris::vectorized::ScannerScheduler::_scanner_scan()
    @     0x556fe8931a0f  _ZNSt17_Function_handlerIFvvEZZN5doris10vectorized16ScannerScheduler6submitESt10shared_ptrINS2_14ScannerContextEES4_INS2_8ScanTaskEEENK3$_1clEvEUlvE_E9_M_invokeERKSt9_Any_data
    @     0x556fd0ed95dc  doris::ThreadPool::dispatch_thread()
    @     0x556fd0eb1288  doris::Thread::supervise_thread()
    @     0x7f95143b5609  start_thread
    @     0x7f9514662133  clone
    @              (nil)  (unknown)
*** Query id: c389fc2a1ff6473c-a06f032b8970810c ***
*** is nereids: 1 ***
*** tablet id: 0 ***
*** Aborted at 1719510556 (unix time) try "date -d @1719510556" if you are using GNU date ***
*** Current BE git commitID: b13c17de9b ***
*** SIGABRT unknown detail explain (@0x3fca33) received by PID 4180531 (TID 4183685 OR 0x7f89734a5700) from PID 4180531; stack trace: ***
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) at /home/zcp/repo_center/doris_master/doris/be/src/common/signal_handler.h:421
 1# 0x00007F9514586090 in /lib/x86_64-linux-gnu/libc.so.6
 2# raise at ../sysdeps/unix/sysv/linux/raise.c:51
 3# abort at /build/glibc-SzIz7B/glibc-2.31/stdlib/abort.c:81
 4# 0x0000557004718C9D in /mnt/hdd01/ci/compatibility-deploy/be/lib/doris_be
 5# 0x000055700470B2DA in /mnt/hdd01/ci/compatibility-deploy/be/lib/doris_be
 6# google::LogMessage::SendToLog() in /mnt/hdd01/ci/compatibility-deploy/be/lib/doris_be
 7# google::LogMessage::Flush() in /mnt/hdd01/ci/compatibility-deploy/be/lib/doris_be
 8# google::LogMessageFatal::~LogMessageFatal() in /mnt/hdd01/ci/compatibility-deploy/be/lib/doris_be
 9# doris::DeleteHandler::init(std::shared_ptr<doris::TabletSchema>, std::vector<std::shared_ptr<doris::RowsetMeta>, std::allocator<std::shared_ptr<doris::RowsetMeta> > > const&, long, bool) at /home/zcp/repo_center/doris_master/doris/be/src/olap/delete_handler.cpp:388
10# doris::TabletReader::_init_delete_condition(doris::TabletReader::ReaderParams const&) at /home/zcp/repo_center/doris_master/doris/be/src/olap/tablet_reader.cpp:654
11# doris::TabletReader::_init_params(doris::TabletReader::ReaderParams const&) at /home/zcp/repo_center/doris_master/doris/be/src/olap/tablet_reader.cpp:295
12# doris::TabletReader::init(doris::TabletReader::ReaderParams const&) at /home/zcp/repo_center/doris_master/doris/be/src/olap/tablet_reader.cpp:128
13# doris::vectorized::BlockReader::init(doris::TabletReader::ReaderParams const&) in /mnt/hdd01/ci/compatibility-deploy/be/lib/doris_be
14# doris::vectorized::NewOlapScanner::open(doris::RuntimeState*) at /home/zcp/repo_center/doris_master/doris/be/src/vec/exec/scan/new_olap_scanner.cpp:219
15# doris::vectorized::ScannerScheduler::_scanner_scan(std::shared_ptr<doris::vectorized::ScannerContext>, std::shared_ptr<doris::vectorized::ScanTask>) at /home/zcp/repo_center/doris_master/doris/be/src/vec/exec/scan/scanner_scheduler.cpp:250
16# std::_Function_handler<void (), doris::vectorized::ScannerScheduler::submit(std::shared_ptr<doris::vectorized::ScannerContext>, std::shared_ptr<doris::vectorized::ScanTask>)::$_1::operator()() const::{lambda()#1}>::_M_invoke(std::_Any_data const&) at /var/local/ldb_toolchain/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_function.h:291
17# doris::ThreadPool::dispatch_thread() in /mnt/hdd01/ci/compatibility-deploy/be/lib/doris_be
18# doris::Thread::supervise_thread(void*) at /home/zcp/repo_center/doris_master/doris/be/src/util/thread.cpp:499
19# start_thread at /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:478
20# __clone at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97

related PRs: https://github.com/apache/doris/pull/36090, https://github.com/apache/doris/pull/36101, https://github.com/apache/doris/pull/36314

doris-robot commented 2 days ago

Thank you for your contribution to Apache Doris. Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website. See Doris Document.

bobhan1 commented 2 days ago

run buildall

github-actions[bot] commented 2 days ago

PR approved by at least one committer and no changes requested.

github-actions[bot] commented 2 days ago

PR approved by anyone and no changes requested.

github-actions[bot] commented 2 days ago

clang-tidy review says "All clean, LGTM! :+1:"

doris-robot commented 2 days ago
TPC-H: Total hot run time: 39883 ms ``` machine: 'aliyun_ecs.c7a.8xlarge_32C64G' scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools Tpch sf100 test result on commit 9867451608cd08ad83df7429396b498e4eeeebc0, data reload: false ------ Round 1 ---------------------------------- q1 18006 4607 4359 4359 q2 2579 199 202 199 q3 12800 1200 1105 1105 q4 10574 721 838 721 q5 8454 2801 2607 2607 q6 222 141 140 140 q7 945 596 602 596 q8 9222 2066 2048 2048 q9 8770 6472 6483 6472 q10 8971 3741 3759 3741 q11 450 238 238 238 q12 535 234 235 234 q13 17772 2978 2956 2956 q14 264 225 215 215 q15 524 477 491 477 q16 509 390 384 384 q17 953 698 729 698 q18 8052 7372 7407 7372 q19 3319 1526 1402 1402 q20 642 319 322 319 q21 5074 3264 3836 3264 q22 392 342 336 336 Total cold run time: 119029 ms Total hot run time: 39883 ms ----- Round 2, with runtime_filter_mode=off ----- q1 4475 4272 4230 4230 q2 366 288 262 262 q3 3032 2748 2719 2719 q4 1923 1649 1629 1629 q5 5227 5244 5266 5244 q6 222 132 132 132 q7 2086 1709 1716 1709 q8 3192 3321 3283 3283 q9 8361 8331 8363 8331 q10 3838 3705 3722 3705 q11 581 485 505 485 q12 795 592 603 592 q13 17511 3004 3004 3004 q14 290 268 266 266 q15 531 489 483 483 q16 465 418 442 418 q17 1752 1474 1457 1457 q18 7573 7482 7353 7353 q19 1663 1616 1786 1616 q20 1955 1764 1747 1747 q21 4847 4766 4686 4686 q22 605 532 567 532 Total cold run time: 71290 ms Total hot run time: 53883 ms ```
doris-robot commented 2 days ago
TPC-DS: Total hot run time: 172686 ms ``` machine: 'aliyun_ecs.c7a.8xlarge_32C64G' scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools TPC-DS sf100 test result on commit 9867451608cd08ad83df7429396b498e4eeeebc0, data reload: false query1 913 379 378 378 query2 6464 2319 2316 2316 query3 6658 208 223 208 query4 18665 17231 17351 17231 query5 4232 503 474 474 query6 278 178 169 169 query7 4610 304 303 303 query8 309 283 293 283 query9 8521 2390 2370 2370 query10 617 329 293 293 query11 10475 10037 9928 9928 query12 143 86 83 83 query13 1660 375 377 375 query14 10108 7758 6995 6995 query15 260 186 192 186 query16 8141 275 265 265 query17 1913 572 559 559 query18 2117 285 280 280 query19 203 210 153 153 query20 90 81 82 81 query21 208 132 133 132 query22 4424 4022 3883 3883 query23 33807 33058 32945 32945 query24 11857 2810 2853 2810 query25 640 375 373 373 query26 1725 150 156 150 query27 2916 312 313 312 query28 7584 2061 2057 2057 query29 980 629 642 629 query30 267 154 159 154 query31 957 702 762 702 query32 94 52 55 52 query33 769 303 295 295 query34 930 482 489 482 query35 733 644 633 633 query36 1068 953 947 947 query37 181 84 79 79 query38 2847 2755 2754 2754 query39 843 810 826 810 query40 275 128 128 128 query41 62 53 51 51 query42 121 103 107 103 query43 587 559 535 535 query44 1199 727 733 727 query45 199 165 191 165 query46 1080 730 716 716 query47 1847 1763 1741 1741 query48 372 298 301 298 query49 1189 425 419 419 query50 774 382 405 382 query51 6862 6869 6709 6709 query52 108 93 95 93 query53 362 299 297 297 query54 900 451 445 445 query55 77 75 76 75 query56 286 268 276 268 query57 1154 1033 1050 1033 query58 254 256 281 256 query59 3374 3004 3357 3004 query60 309 293 285 285 query61 95 97 94 94 query62 652 449 441 441 query63 329 295 298 295 query64 9832 2235 1803 1803 query65 3199 3192 3099 3099 query66 1387 342 343 342 query67 15246 15060 14940 14940 query68 4655 562 554 554 query69 639 424 351 351 query70 1136 1144 1068 1068 query71 423 289 285 285 query72 7039 5347 5519 5347 query73 756 328 326 326 query74 5796 5538 5541 5538 query75 3694 2661 2684 2661 query76 3272 981 898 898 query77 644 302 301 301 query78 10332 9888 9833 9833 query79 2391 521 534 521 query80 1640 474 472 472 query81 557 218 219 218 query82 982 111 115 111 query83 287 165 169 165 query84 261 92 87 87 query85 1631 274 277 274 query86 488 327 290 290 query87 3226 3143 3053 3053 query88 3981 2369 2376 2369 query89 471 394 387 387 query90 1792 194 195 194 query91 128 99 100 99 query92 65 49 51 49 query93 1999 512 510 510 query94 1248 191 191 191 query95 419 333 325 325 query96 598 269 262 262 query97 3238 3050 3038 3038 query98 233 203 190 190 query99 1312 851 846 846 Total cold run time: 276671 ms Total hot run time: 172686 ms ```
doris-robot commented 2 days ago
ClickBench: Total hot run time: 30.73 s ``` machine: 'aliyun_ecs.c7a.8xlarge_32C64G' scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools ClickBench test result on commit 9867451608cd08ad83df7429396b498e4eeeebc0, data reload: false query1 0.04 0.04 0.03 query2 0.08 0.04 0.04 query3 0.22 0.04 0.05 query4 1.70 0.07 0.10 query5 0.50 0.52 0.48 query6 1.13 0.74 0.73 query7 0.02 0.01 0.01 query8 0.05 0.04 0.04 query9 0.54 0.49 0.49 query10 0.54 0.52 0.54 query11 0.15 0.12 0.11 query12 0.15 0.13 0.12 query13 0.60 0.59 0.62 query14 0.75 0.79 0.78 query15 0.85 0.81 0.82 query16 0.36 0.36 0.35 query17 0.96 1.05 1.03 query18 0.23 0.25 0.26 query19 1.83 1.83 1.75 query20 0.02 0.01 0.01 query21 15.47 0.76 0.65 query22 3.86 7.61 2.00 query23 18.30 1.34 1.27 query24 2.11 0.21 0.23 query25 0.15 0.09 0.08 query26 0.26 0.18 0.18 query27 0.08 0.08 0.08 query28 13.22 1.02 1.01 query29 12.61 3.33 3.22 query30 0.25 0.06 0.07 query31 2.86 0.40 0.38 query32 3.31 0.47 0.49 query33 2.86 2.87 2.95 query34 17.22 4.46 4.45 query35 4.56 4.48 4.51 query36 0.65 0.46 0.49 query37 0.18 0.15 0.16 query38 0.16 0.14 0.15 query39 0.05 0.04 0.04 query40 0.17 0.14 0.15 query41 0.09 0.05 0.05 query42 0.06 0.05 0.05 query43 0.05 0.04 0.04 Total cold run time: 109.25 s Total hot run time: 30.73 s ```
bobhan1 commented 2 days ago

run buildall

github-actions[bot] commented 2 days ago

clang-tidy review says "All clean, LGTM! :+1:"

github-actions[bot] commented 2 days ago

clang-tidy review says "All clean, LGTM! :+1:"

doris-robot commented 2 days ago
TPC-H: Total hot run time: 40024 ms ``` machine: 'aliyun_ecs.c7a.8xlarge_32C64G' scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools Tpch sf100 test result on commit fef336a3b718e577ae4d0acd86bd4165b0928785, data reload: false ------ Round 1 ---------------------------------- q1 17593 4568 4325 4325 q2 2018 193 195 193 q3 10470 1263 1156 1156 q4 10196 835 798 798 q5 7510 2773 2608 2608 q6 222 140 138 138 q7 957 592 616 592 q8 9226 2113 2088 2088 q9 8909 6520 6477 6477 q10 8984 3766 3726 3726 q11 470 235 242 235 q12 438 242 234 234 q13 17772 2978 3014 2978 q14 271 240 227 227 q15 538 501 492 492 q16 528 378 381 378 q17 996 671 796 671 q18 8157 7457 7378 7378 q19 6273 1560 1378 1378 q20 660 315 354 315 q21 5027 3300 3366 3300 q22 400 340 337 337 Total cold run time: 117615 ms Total hot run time: 40024 ms ----- Round 2, with runtime_filter_mode=off ----- q1 4405 4242 4205 4205 q2 365 274 266 266 q3 3001 2952 2925 2925 q4 2029 1748 1757 1748 q5 5603 5506 5489 5489 q6 218 135 133 133 q7 2256 1842 1866 1842 q8 3276 3413 3514 3413 q9 8721 8773 8790 8773 q10 4189 3789 3751 3751 q11 590 501 504 501 q12 825 629 655 629 q13 16210 3166 3165 3165 q14 293 295 298 295 q15 530 486 490 486 q16 484 455 454 454 q17 1853 1516 1535 1516 q18 8102 7910 7696 7696 q19 2582 1696 1535 1535 q20 2484 1863 1831 1831 q21 5019 4919 4807 4807 q22 595 544 570 544 Total cold run time: 73630 ms Total hot run time: 56004 ms ```
doris-robot commented 2 days ago
TPC-DS: Total hot run time: 174959 ms ``` machine: 'aliyun_ecs.c7a.8xlarge_32C64G' scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools TPC-DS sf100 test result on commit fef336a3b718e577ae4d0acd86bd4165b0928785, data reload: false query1 915 395 375 375 query2 6479 2492 2369 2369 query3 6639 208 212 208 query4 18950 17438 17398 17398 query5 3727 475 498 475 query6 275 166 165 165 query7 4584 305 287 287 query8 320 302 316 302 query9 8439 2372 2353 2353 query10 575 318 284 284 query11 11074 10137 9993 9993 query12 116 86 86 86 query13 1650 366 367 366 query14 10143 7768 7773 7768 query15 251 199 191 191 query16 8021 282 279 279 query17 1879 570 547 547 query18 2084 286 275 275 query19 198 153 160 153 query20 89 84 82 82 query21 211 128 125 125 query22 4312 4044 3944 3944 query23 34148 33698 33656 33656 query24 10557 2944 2903 2903 query25 642 383 403 383 query26 695 161 161 161 query27 2247 317 327 317 query28 6019 2155 2153 2153 query29 894 636 639 636 query30 252 161 158 158 query31 993 777 774 774 query32 94 51 53 51 query33 661 302 295 295 query34 877 481 492 481 query35 753 625 651 625 query36 1119 1012 979 979 query37 138 77 81 77 query38 2985 2826 2807 2807 query39 866 827 841 827 query40 209 126 120 120 query41 54 50 51 50 query42 115 101 104 101 query43 587 549 521 521 query44 1038 718 736 718 query45 189 158 162 158 query46 1072 699 702 699 query47 1867 1782 1767 1767 query48 363 297 292 292 query49 855 436 419 419 query50 761 384 381 381 query51 6861 6766 6699 6699 query52 105 92 92 92 query53 353 289 289 289 query54 924 458 439 439 query55 72 74 75 74 query56 287 270 269 269 query57 1156 1037 1050 1037 query58 243 245 253 245 query59 3370 3198 3058 3058 query60 302 276 290 276 query61 98 92 95 92 query62 604 432 456 432 query63 348 286 291 286 query64 8499 2251 1755 1755 query65 3174 3080 3096 3080 query66 746 328 324 324 query67 15559 14952 14918 14918 query68 4665 522 536 522 query69 612 424 317 317 query70 1129 1156 1146 1146 query71 420 283 283 283 query72 8498 5874 5906 5874 query73 731 327 323 323 query74 5895 5472 5426 5426 query75 3634 2602 2681 2602 query76 2957 912 866 866 query77 642 310 299 299 query78 10494 9831 9906 9831 query79 2913 515 510 510 query80 1339 462 462 462 query81 557 222 225 222 query82 841 111 117 111 query83 351 174 178 174 query84 275 86 87 86 query85 1786 282 279 279 query86 445 306 330 306 query87 3386 3106 3096 3096 query88 4383 2366 2352 2352 query89 486 394 389 389 query90 1846 187 181 181 query91 131 101 101 101 query92 64 52 50 50 query93 4397 502 494 494 query94 1106 181 185 181 query95 406 318 311 311 query96 600 261 267 261 query97 3204 3047 2965 2965 query98 226 202 197 197 query99 1186 849 843 843 Total cold run time: 274287 ms Total hot run time: 174959 ms ```
doris-robot commented 2 days ago
ClickBench: Total hot run time: 30.48 s ``` machine: 'aliyun_ecs.c7a.8xlarge_32C64G' scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools ClickBench test result on commit fef336a3b718e577ae4d0acd86bd4165b0928785, data reload: false query1 0.04 0.04 0.03 query2 0.08 0.03 0.04 query3 0.23 0.05 0.06 query4 1.66 0.08 0.08 query5 0.51 0.48 0.49 query6 1.13 0.73 0.72 query7 0.02 0.02 0.01 query8 0.05 0.05 0.05 query9 0.54 0.48 0.48 query10 0.55 0.53 0.55 query11 0.14 0.11 0.12 query12 0.14 0.12 0.14 query13 0.58 0.58 0.61 query14 0.80 0.77 0.78 query15 0.83 0.81 0.81 query16 0.37 0.38 0.36 query17 0.97 0.97 1.00 query18 0.23 0.21 0.27 query19 1.84 1.68 1.73 query20 0.01 0.01 0.01 query21 15.46 0.79 0.65 query22 4.47 6.95 1.91 query23 18.28 1.34 1.31 query24 2.07 0.23 0.23 query25 0.15 0.08 0.09 query26 0.27 0.18 0.18 query27 0.08 0.07 0.08 query28 13.21 1.02 1.01 query29 12.55 3.25 3.25 query30 0.26 0.06 0.06 query31 2.85 0.40 0.38 query32 3.27 0.46 0.46 query33 2.87 2.92 2.92 query34 17.13 4.38 4.41 query35 4.50 4.47 4.46 query36 0.65 0.47 0.50 query37 0.19 0.15 0.16 query38 0.16 0.15 0.15 query39 0.05 0.03 0.04 query40 0.18 0.15 0.13 query41 0.10 0.04 0.05 query42 0.06 0.05 0.04 query43 0.04 0.04 0.04 Total cold run time: 109.57 s Total hot run time: 30.48 s ```