Uploaded image for project: 'Kudu'
  1. Kudu
  2. KUDU-2428

Segmentation fault when calling add_range_partition multiple times

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Invalid
    • Affects Version/s: 1.7.0
    • Fix Version/s: Backlog
    • Component/s: client
    • Labels:
      None
    • Target Version/s:

      Description

      Hi,

      I'm trying to modify and run the following sample.cc program to create a table with multiple range partitions via multiple calls to add_range_partition() and the program got a Segmentation fault. 

      On the other hand, if I call add_range_partition() once and the program runs fine.  

      So I'm wondering if calling add_range_partition() multiple times for a single table is supported or not?  This makes it useful when trying to partition the range on multiple primary key columns, e.g. on (key, int_val).

      Thanks.

       

      Modified only the following function in $HOME/kudu/src/kudu/client/samples/sample.cc

      static Status CreateTable(const shared_ptr<KuduClient>& client,
       const string& table_name,
       const KuduSchema& schema,
       int num_tablets) {
      
      KuduPartialRow* row = schema.NewRow();
       KUDU_CHECK_OK(row->SetInt32("key", 100));
      
      KuduPartialRow* row2 = schema.NewRow();
       KUDU_CHECK_OK(row2->SetInt32("key", 100));
      
      KuduPartialRow* row3 = schema.NewRow();
       KUDU_CHECK_OK(row3->SetInt32("key", 200));
      
      KuduPartialRow* row4 = schema.NewRow();
       KUDU_CHECK_OK(row4->SetInt32("key", 200));
      
      vector<string> column_names;
       column_names.push_back("key");
      
      // Create the table.
       KuduTableCreator* table_creator = client->NewTableCreator();
       table_creator->add_range_partition(row, row2);
       table_creator->add_range_partition(row2, row3);
       table_creator->add_range_partition(row3, row4);
      
      
       Status s = table_creator->table_name(table_name)
       .schema(&schema)
       .set_range_partition_columns(column_names)
      .set_engine_name(DEFAULT_ENGINE_NAME)
       .num_replicas(1)
       .Create();
       delete table_creator;
       return s;
      }
      

       

      Running it fails as follows:

      $ ./sample 127.0.0.1

      Segmentation fault (core dumped)

       

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mikefeng Mike Feng
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: