Skip to content

Conversation

@cambyzju
Copy link
Contributor

@cambyzju cambyzju commented Aug 29, 2025

What problem does this PR solve?

Problem:
Incorrect input arguments for auto_partition_name cause a fallback to the legacy planner in branch 2.1. However, since this function is handled by the FE legacy code, there is no parameter checking logic. (See: #38853)

Furthermore, there is a lack of sufficient checks on the BE side, which can lead to crashes. Such as:

select auto_partition_name("xxx");
select auto_partition_name("xxx", "sss");

How to Fix:
So here we simply remove function auto_partition_name in legacy planner

The stack is like:

*** Query id: 24c69ac956394483-b2a4d08963d06593 ***
*** is nereids: 0 ***
*** tablet id: 0 ***
*** Aborted at 1756449846 (unix time) try "date -d @1756449846" if you are using GNU date ***
*** Current BE git commitID: 2506121 ***
*** SIGSEGV address not mapped to object (@0x0) received by PID 1010328 (TID 1011344 OR 0x7f75ba07a6c0) from PID 0; stack trace: ***
 0# doris::signal::(anonymous namespace)::FailureSignalHandler(int, siginfo_t*, void*) in /usr/local/service/doris/lib/be/doris_be
 1# os::Linux::chained_handler(int, siginfo*, void*) in /usr/local/jdk/jre/lib/amd64/server/libjvm.so
 2# JVM_handle_linux_signal in /usr/local/jdk/jre/lib/amd64/server/libjvm.so
 3# signalHandler(int, siginfo*, void*) in /usr/local/jdk/jre/lib/amd64/server/libjvm.so
 4# 0x00007F77D0EA1AD0 in /lib64/libc.so.6
 5# doris::vectorized::PreparedFunctionImpl::default_implementation_for_constant_arguments(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long, bool, bool*) const in /usr/local/service/doris/lib/be/doris_be
 6# doris::vectorized::PreparedFunctionImpl::execute_without_low_cardinality_columns(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long, bool) const in /usr/local/service/doris/lib/be/doris_be
 7# doris::vectorized::PreparedFunctionImpl::execute(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long, bool) const in /usr/local/service/doris/lib/be/doris_be
 8# doris::vectorized::IFunctionBase::execute(doris::FunctionContext*, doris::vectorized::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long, bool) const in /usr/local/service/doris/lib/be/doris_be
 9# doris::vectorized::VectorizedFnCall::_do_execute(doris::vectorized::VExprContext*, doris::vectorized::Block*, int*, std::vector<unsigned long, std::allocator<unsigned long> >&) in /usr/local/service/doris/lib/be/doris_be
10# doris::vectorized::VectorizedFnCall::execute(doris::vectorized::VExprContext*, doris::vectorized::Block*, int*) in /usr/local/service/doris/lib/be/doris_be
11# doris::vectorized::VExpr::get_const_col(doris::vectorized::VExprContext*, std::shared_ptr<doris::ColumnPtrWrapper>*) in /usr/local/service/doris/lib/be/doris_be
12# doris::vectorized::VectorizedFnCall::open(doris::RuntimeState*, doris::vectorized::VExprContext*, doris::FunctionContext::FunctionStateScope) in /usr/local/service/doris/lib/be/doris_be
13# doris::vectorized::VExprContext::open(doris::RuntimeState*) in /usr/local/service/doris/lib/be/doris_be
14# doris::vectorized::VExpr::open(std::vector<std::shared_ptr<doris::vectorized::VExprContext>, std::allocator<std::shared_ptr<doris::vectorized::VExprContext> > > const&, doris::RuntimeState*) in /usr/local/service/doris/lib/be/doris_be
15# doris::pipeline::UnionSourceOperatorX::open(doris::RuntimeState*) in /usr/local/service/doris/lib/be/doris_be
16# doris::pipeline::Pipeline::prepare(doris::RuntimeState*) in /usr/local/service/doris/lib/be/doris_be
17# doris::pipeline::PipelineXFragmentContext::prepare(doris::TPipelineFragmentParams const&, doris::ThreadPool*) in /usr/local/service/doris/lib/be/doris_be
18# doris::FragmentMgr::exec_plan_fragment(doris::TPipelineFragmentParams const&, doris::QuerySource, std::function<void (doris::RuntimeState*, doris::Status*)> const&) in /usr/local/service/doris/lib/be/doris_be
19# doris::FragmentMgr::exec_plan_fragment(doris::TPipelineFragmentParams const&, doris::QuerySource) in /usr/local/service/doris/lib/be/doris_be

Release note

None

Check List (For Author)

  • Test

    • 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
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@cambyzju cambyzju requested a review from yiguolei as a code owner August 29, 2025 06:46
@Thearas
Copy link
Contributor

Thearas commented Aug 29, 2025

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

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@cambyzju
Copy link
Contributor Author

run buildall

@liutang123
Copy link
Contributor

Does 3.0+ have this promlem?

Copy link
Contributor

@lide-reed lide-reed left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Sep 4, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2025

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

@github-actions
Copy link
Contributor

github-actions bot commented Sep 4, 2025

PR approved by anyone and no changes requested.

Copy link
Member

@xy720 xy720 left a comment

Choose a reason for hiding this comment

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

LGTM

@cambyzju
Copy link
Contributor Author

cambyzju commented Sep 9, 2025

Does 3.0+ have this promlem?

只在旧优化器有问题,3.0不会fallback了,所以没有问题。

@yiguolei yiguolei merged commit 21307dc into apache:branch-2.1 Sep 15, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/2.1.x reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants