Skip to content

http update + distributed table + wrong replication cluster = crash #3481

Closed
@sanikolaev

Description

@sanikolaev

Bug Description:

If you try to run /update on a document in a distributed table and specify a cluster that the tables of the distributed table don't belong to, it will crash.

# mysql -v -P9306 -h0 -e "drop table if exists t; create table t(f int); drop table if exists d; CREATE TABLE d type='distributed' agent='127.0.0.1:9312:t'"

--------------
drop table if exists t
--------------

--------------
create table t(f int)
--------------

--------------
drop table if exists d
--------------

--------------
CREATE TABLE d type='distributed' agent='127.0.0.1:9312:t'
--------------

# curl -s -X POST http://localhost:9312/update -d '{"cluster": "unknown_cluster", "table": "d", "id": 2, "doc": {"f": 5}}'

Backtrace:

 0# sphBacktrace(int, bool) in /opt/homebrew/Cellar/manticoresearch-dev/10.2.3-25061609-1f8a194f0/bin/searchd
 1# HandleCrash(int) in /opt/homebrew/Cellar/manticoresearch-dev/10.2.3-25061609-1f8a194f0/bin/searchd
 2# _sigtramp in /usr/lib/system/libsystem_platform.dylib
 3# ProcessHttpQueryBuddy(HttpProcessResult_t&, std::__1::pair<char const*, int>, CSphOrderedHash<CSphString, CSphString, CSphStrHashFunc, 256>&, sph::Vector_T<unsigned char, sph::DefaultCopy_T<unsigned ch
ar>, sph::DefaultRelimit, sph::DefaultStorage_T<unsigned char>>&, bool, http_method) in /opt/homebrew/Cellar/manticoresearch-dev/10.2.3-25061609-1f8a194f0/bin/searchd
 4# sphProcessHttpQueryNoResponce(CSphString const&, CSphString const&, sph::Vector_T<unsigned char, sph::DefaultCopy_T<unsigned char>, sph::DefaultRelimit, sph::DefaultStorage_T<unsigned char>>&) in /opt/
homebrew/Cellar/manticoresearch-dev/10.2.3-25061609-1f8a194f0/bin/searchd
 5# HandleCommandJson(ISphOutputBuffer&, unsigned short, InputBuffer_c&) in /opt/homebrew/Cellar/manticoresearch-dev/10.2.3-25061609-1f8a194f0/bin/searchd
 6# ExecuteApiCommand(SearchdCommand_e, unsigned short, int, InputBuffer_c&, GenericOutputBuffer_c&) in /opt/homebrew/Cellar/manticoresearch-dev/10.2.3-25061609-1f8a194f0/bin/searchd
 7# ApiServe(std::__1::unique_ptr<AsyncNetBuffer_c, std::__1::default_delete<AsyncNetBuffer_c>>) in /opt/homebrew/Cellar/manticoresearch-dev/10.2.3-25061609-1f8a194f0/bin/searchd
 8# MultiServe(std::__1::unique_ptr<AsyncNetBuffer_c, std::__1::default_delete<AsyncNetBuffer_c>>, std::__1::pair<int, unsigned char>, Proto_e) in /opt/homebrew/Cellar/manticoresearch-dev/10.2.3-25061609-1
f8a194f0/bin/searchd
 9# std::__1::__function::__func<NetActionAccept_c::Impl_c::ProcessAccept()::$_3, std::__1::allocator<NetActionAccept_c::Impl_c::ProcessAccept()::$_3>, void ()>::operator()() in /opt/homebrew/Cellar/manticoresearch-dev/10.2.3-25061609-1f8a194f0/bin/searchd
10# Threads::CoRoutine_c::CreateContext(std::__1::function<void ()>, std::__1::pair<boost::context::stack_context, Threads::StackFlavour_E>)::'lambda'(boost::context::detail::transfer_t)::__invoke(boost::context::detail::transfer_t) in /opt/homebrew/Cellar/manticoresearch-dev/10.2.3-25061609-1f8a194f0/bin/searchd

Manticore Search Version:

Manticore 10.2.3 1f8a194f0@25061609 dev (columnar 4.2.2 31be562@25052112) (secondary 4.2.2 31be562@25052112)

Operating System Version:

Macos

Have you tried the latest development version?

Yes

Internal Checklist:

To be completed by the assignee. Check off tasks that have been completed or are not applicable.

  • Implementation completed
  • Tests developed
  • Documentation updated
  • Documentation reviewed

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions