Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-7403

AnalyticEvalNode does not manage BufferedTupleStream memory correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • Impala 2.5.0, Impala 2.6.0, Impala 2.7.0, Impala 2.8.0, Impala 2.9.0, Impala 2.10.0, Impala 2.11.0, Impala 3.0, Impala 2.12.0, Impala 3.1.0
    • Impala 3.1.0
    • Backend

    Description

      The query generator has discovered a crash. I took one of the crashing queries and simplified it down as far as I could go. I searched for existing bugs with the same dcheck and didn't strictly see anything but I know there are other bugs right now and this may end up being a dupe.

      reservation-tracker.cc:428] Check failed: used_reservation_ + child_reservations_ <= reservation_ (6291456 vs. 4194304)
      
      #6  0x000000000437961e in google::LogMessageFatal::~LogMessageFatal() ()
      #7  0x00000000020636c6 in impala::ReservationTracker::CheckConsistency() const (this=0xe08da58) at /home/mikeb/Impala/be/src/runtime/bufferpool/reservation-tracker.cc:428
      #8  0x0000000002062888 in impala::ReservationTracker::TransferReservationTo(impala::ReservationTracker*, long) (this=0xe08da58, other=0x11cae530, bytes=2097152) at /home/mikeb/Impala/be/src/runtime/bufferpool/reservation-tracker.cc:358
      #9  0x0000000002057b10 in impala::BufferPool::ClientHandle::SaveReservation(impala::BufferPool::SubReservation*, long) (this=0xbf26190, dst=0xcfd40e8, bytes=2097152) at /home/mikeb/Impala/be/src/runtime/bufferpool/buffer-pool.cc:347
      #10 0x000000000318f209 in impala::BufferedTupleStream::NextReadPage() (this=0xcfd4000) at /home/mikeb/Impala/be/src/runtime/buffered-tuple-stream.cc:541
      #11 0x0000000003195037 in impala::BufferedTupleStream::GetNextInternal<false, false>(impala::RowBatch*, bool*, std::vector<unsigned char*, std::allocator<unsigned char*> >*) (this=0xcfd4000, batch=0x7efff313bc90, eos=0x7efff313c12f, flat_rows=0x0)
          at /home/mikeb/Impala/be/src/runtime/buffered-tuple-stream.cc:727
      #12 0x0000000003192bf1 in impala::BufferedTupleStream::GetNextInternal<false>(impala::RowBatch*, bool*, std::vector<unsigned char*, std::allocator<unsigned char*> >*) (this=0xcfd4000, batch=0x7efff313bc90, eos=0x7efff313c12f, flat_rows=0x0)
          at /home/mikeb/Impala/be/src/runtime/buffered-tuple-stream.cc:698
      #13 0x000000000319035a in impala::BufferedTupleStream::GetNext(impala::RowBatch*, bool*) (this=0xcfd4000, batch=0x7efff313bc90, eos=0x7efff313c12f) at /home/mikeb/Impala/be/src/runtime/buffered-tuple-stream.cc:684
      #14 0x0000000002e8ca0b in impala::AnalyticEvalNode::GetNextOutputBatch(impala::RuntimeState*, impala::RowBatch*, bool*) (this=0xbf26000, state=0xe575d40, output_batch=0xb98a5a0, eos=0x7efff313c12f)
          at /home/mikeb/Impala/be/src/exec/analytic-eval-node.cc:719
      #15 0x0000000002e8dfe7 in impala::AnalyticEvalNode::GetNext(impala::RuntimeState*, impala::RowBatch*, bool*) (this=0xbf26000, state=0xe575d40, row_batch=0xb98a5a0, eos=0xbf27fd8) at /home/mikeb/Impala/be/src/exec/analytic-eval-node.cc:789
      #16 0x0000000002e8b36a in impala::AnalyticEvalNode::ProcessChildBatches(impala::RuntimeState*) (this=0xbf27c00, state=0xe575d40) at /home/mikeb/Impala/be/src/exec/analytic-eval-node.cc:602
      #17 0x0000000002e8df37 in impala::AnalyticEvalNode::GetNext(impala::RuntimeState*, impala::RowBatch*, bool*) (this=0xbf27c00, state=0xe575d40, row_batch=0xe904e40, eos=0x7efff313c5cf) at /home/mikeb/Impala/be/src/exec/analytic-eval-node.cc:786
      #18 0x0000000001df28b8 in impala::FragmentInstanceState::ExecInternal() (this=0xbf39a00) at /home/mikeb/Impala/be/src/runtime/fragment-instance-state.cc:286
      #19 0x0000000001defd35 in impala::FragmentInstanceState::Exec() (this=0xbf39a00) at /home/mikeb/Impala/be/src/runtime/fragment-instance-state.cc:90
      #20 0x0000000001dff3ad in impala::QueryState::ExecFInstance(impala::FragmentInstanceState*) (this=0xd50a800, fis=0xbf39a00) at /home/mikeb/Impala/be/src/runtime/query-state.cc:401
      #21 0x0000000001dfdb4c in impala::QueryState::<lambda()>::operator()(void) const (__closure=0x7efff313cca8) at /home/mikeb/Impala/be/src/runtime/query-state.cc:341
      #22 0x0000000001e000cb in boost::detail::function::void_function_obj_invoker0<impala::QueryState::StartFInstances()::<lambda()>, void>::invoke(boost::detail::function::function_buffer &) (function_obj_ptr=...)
          at /home/mikeb/Impala/toolchain/boost-1.57.0-p3/include/boost/function/function_template.hpp:153
      #23 0x0000000001c22aba in boost::function0<void>::operator()() const (this=0x7efff313cca0) at /home/mikeb/Impala/toolchain/boost-1.57.0-p3/include/boost/function/function_template.hpp:767
      #24 0x000000000203040b in impala::Thread::SuperviseThread(std::string const&, std::string const&, boost::function<void ()>, impala::ThreadDebugInfo const*, impala::Promise<long, (impala::PromiseMode)0>*) (name="exec-finstance (finst:874e82d6ebf71b93:46020d9e00000000)", category="fragment-execution", functor=..., parent_thread_info=0x7efff393d950, thread_started=0x7efff393c8e0) at /home/mikeb/Impala/be/src/util/thread.cc:356
      #25 0x00000000020384e3 in boost::_bi::list5<boost::_bi::value<std::string>, boost::_bi::value<std::string>, boost::_bi::value<boost::function<void ()> >, boost::_bi::value<impala::ThreadDebugInfo*>, boost::_bi::value<impala::Promise<long, (impala::PromiseMode)0>*> >::operator()<void (*)(std::string const&, std::string const&, boost::function<void ()>, impala::ThreadDebugInfo const*, impala::Promise<long, (impala::PromiseMode)0>*), boost::_bi::list0>(boost::_bi::type<void>, void (*&)(std::string const&, std::string const&, boost::function<void ()>, impala::ThreadDebugInfo const*, impala::Promise<long, (impala::PromiseMode)0>*), boost::_bi::list0&, int) (this=0xbf39dc0, f=@0xbf39db8: 0x20300a4 <impala::Thread::SuperviseThread(std::string const&, std::string const&, boost::function<void ()>, impala::ThreadDebugInfo const*, impala::Promise<long, (impala::PromiseMode)0>*)>, a=...) at /home/mikeb/Impala/toolchain/boost-1.57.0-p3/include/boost/bind/bind.hpp:525
      #26 0x0000000002038407 in boost::_bi::bind_t<void, void (*)(std::string const&, std::string const&, boost::function<void ()>, impala::ThreadDebugInfo const*, impala::Promise<long, (impala::PromiseMode)0>*), boost::_bi::list5<boost::_bi::value<std::string>, boost::_bi::value<std::string>, boost::_bi::value<boost::function<void ()> >, boost::_bi::value<impala::ThreadDebugInfo*>, boost::_bi::value<impala::Promise<long, (impala::PromiseMode)0>*> > >::operator()() (this=0xbf39db8)
          at /home/mikeb/Impala/toolchain/boost-1.57.0-p3/include/boost/bind/bind_template.hpp:20
      #27 0x00000000020383ca in boost::detail::thread_data<boost::_bi::bind_t<void, void (*)(std::string const&, std::string const&, boost::function<void ()>, impala::ThreadDebugInfo const*, impala::Promise<long, (impala::PromiseMode)0>*), boost::_bi::list5<boost::_bi::value<std::string>, boost::_bi::value<std::string>, boost::_bi::value<boost::function<void ()> >, boost::_bi::value<impala::ThreadDebugInfo*>, boost::_bi::value<impala::Promise<long, (impala::PromiseMode)0>*> > > >::run() (this=0xbf39c00)
          at /home/mikeb/Impala/toolchain/boost-1.57.0-p3/include/boost/thread/detail/thread.hpp:116
      #28 0x00000000032a1cca in thread_proxy ()
      #29 0x00007f00894b16ba in start_thread (arg=0x7efff313d700) at pthread_create.c:333
      #30 0x00007f00891e741d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
      

      Simplified failing query:

      SELECT
      LAG(1) OVER (ORDER BY p_container),
      MIN(1) OVER (ORDER BY p_container)
      FROM tpch.part
      

      Attachments

        Issue Links

          Activity

            People

              tarmstrong Tim Armstrong
              mikeb Michael Brown
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: