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

Reading Kudu timestamp causes severe kernel spinning due to locking in impala::TimestampValue::UnixTimeToPtime-> __tz_convert

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • Impala 2.9.0
    • Impala 2.9.0
    • Backend
    • ghx-label-6

    Description

      Query

      select l_commitdate, count(*) from lineitem_kudu_ts where l_shipdate between "1992-01-01" and "1992-03-01" group by l_commitdate limit 10
      

      Call stack

      Thread 1 (process 90064):
      #0  0x00000037970f80cf in __lll_unlock_wake_private () from /lib64/libc.so.6
      #1  0x000000379709dcfc in _L_unlock_2225 () from /lib64/libc.so.6
      #2  0x000000379709db31 in __tz_convert () from /lib64/libc.so.6
      #3  0x0000000000a4ca75 in impala::TimestampValue::UnixTimeToPtime(long) ()
      #4  0x0000000000d3aad2 in impala::KuduScanner::DecodeRowsIntoRowBatch(impala::RowBatch*, impala::Tuple**) ()
      #5  0x0000000000d3b05f in impala::KuduScanner::GetNext(impala::RowBatch*, bool*) ()
      #6  0x0000000000cfa5a3 in impala::KuduScanNode::ProcessScanToken(impala::KuduScanner*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
      #7  0x0000000000cfb024 in impala::KuduScanNode::RunScannerThread(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const*) ()
      #8  0x0000000000bed5b9 in impala::Thread::SuperviseThread(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::function<void ()()>, impala::Promise<long>*) ()
      #9  0x0000000000bedf74 in boost::detail::thread_data<boost::_bi::bind_t<void, void (*)(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::function<void ()()>, impala::Promise<long>*), boost::_bi::list4<boost::_bi::value<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::_bi::value<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, boost::_bi::value<boost::function<void ()()> >, boost::_bi::value<impala::Promise<long>*> > > >::run() ()
      #10 0x0000000000e529ca in ?? ()
      #11 0x0000003797407aa1 in start_thread () from /lib64/libpthread.so.0
      #12 0x00000037970e893d in clone () from /lib64/libc.so.6
      

      Table DDL

       CREATE TABLE scan_primitives_tpch_3tb.lineitem_kudu_ts (                                                                                                                  
         l_shipdate STRING NOT NULL ENCODING DICT_ENCODING COMPRESSION LZ4,                                                                                                      
         l_orderkey BIGINT NOT NULL ENCODING BIT_SHUFFLE COMPRESSION LZ4,                                                                                                        
         l_linenumber BIGINT NOT NULL ENCODING BIT_SHUFFLE COMPRESSION LZ4,                                                                                                      
         l_partkey BIGINT NOT NULL ENCODING BIT_SHUFFLE COMPRESSION LZ4,                                                                                                         
         l_suppkey BIGINT NOT NULL ENCODING BIT_SHUFFLE COMPRESSION LZ4,                                                                                                         
         l_quantity DOUBLE NULL ENCODING BIT_SHUFFLE COMPRESSION LZ4,                                                                                                            
         l_extendedprice DOUBLE NULL ENCODING PLAIN_ENCODING COMPRESSION LZ4,                                                                                                    
         l_discount DOUBLE NULL ENCODING BIT_SHUFFLE COMPRESSION LZ4,                                                                                                            
         l_tax DOUBLE NULL ENCODING BIT_SHUFFLE COMPRESSION LZ4,                                                                                                                 
         l_returnflag STRING NULL ENCODING DICT_ENCODING COMPRESSION LZ4,                                                                                                        
         l_linestatus STRING NULL ENCODING DICT_ENCODING COMPRESSION LZ4,                                                                                                        
         l_commitdate TIMESTAMP NULL ENCODING BIT_SHUFFLE COMPRESSION LZ4,                                                                                                       
         l_receiptdate STRING NULL ENCODING DICT_ENCODING COMPRESSION LZ4,                                                                                                       
         l_shipinstruct STRING NULL ENCODING DICT_ENCODING COMPRESSION LZ4,                                                                                                      
         l_shipmode STRING NULL ENCODING DICT_ENCODING COMPRESSION LZ4,                                                                                                          
         l_comment STRING NULL ENCODING PLAIN_ENCODING COMPRESSION LZ4,                                                                                                          
         PRIMARY KEY (l_shipdate, l_orderkey, l_linenumber)                                                                                                                      
       )                                                                                                                                                                         
       PARTITION BY HASH (l_orderkey) PARTITIONS 140                                                                                                                             
       STORED AS KUDU                                                                                                                                                            
       TBLPROPERTIES ('numRows'='17614285211', 'kudu.master_addresses'='foo:7051,foo1:7051', 'STATS_GENERATED_VIA_STATS_TASK'='true') 
       

      Attachments

        1. cast string to timestamp scan-agg_profile.txt
          11 kB
          Mostafa Mokhtar
        2. Screen Shot 2017-05-23 at 6.57.12 PM.png
          162 kB
          Mostafa Mokhtar
        3. string_scan-agg_profile.txt
          11 kB
          Mostafa Mokhtar
        4. timestamp_scan-agg_profile.txt
          12 kB
          Mostafa Mokhtar

        Activity

          People

            mjacobs Matthew Jacobs
            mmokhtar Mostafa Mokhtar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: