Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-3083

Fix a bug in wtperf config dump

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • WT2.9.2, 3.2.13, 3.4.3, 3.5.2
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      wtperf.c main() has logic that generates non default configuration strings. These generated strings are added as an entry in the queue "opts->config_head". This ticket fixes two issues:

      1. The above code even when no non-default configuration to generate, creates empty configuration with commas, something like ",,,". This in itself is a bug
      2. The above code generates an entry and adds to the queue (an empty comma filled entry if no non-default configuration was generated). config_consolidate() is used to consolidate queue entries with same keys. Consolidation is done before dumping the configuration in WT_TEST/CONFIG.wtperf. Consolidation function looks for entries with same configuration key, and discards all except the last one in the queue. (this would be empty ",,," in most cases). Consolidate should concatenate the strings and not discard the previous ones, because WiredTiger would have actually applied them during the test.

      This change fixes the non-default configuration generation code. It won't generate those unnecessary commas anymore. Also I changed consolidate to concatenate queue entries with same configuration key.

      For instance, for the following configuration:

      # wtperf options file: evict btree configuration
      conn_config="cache_size=10G,eviction=(threads_max=4),statistics=(fast),statistics_log=(wait=1,json=true)"
      table_config="type=file"
      icount=100000
      # 1 billion keys
      random_range=1000000000
      # 5000 tables - 200 thousand keys each
      range_partition=false
      table_count=200
      report_interval=1
      run_time=2000
      populate_threads=1
      threads=((count=12,inserts=1),(count=3,reads=1))
      # Add throughput/latency monitoring
      max_latency=2000
      sample_interval=5
      

      Following is dumped in logs:

      $ cat WT_TEST/CONFIG.wtperf 
      # Warning: This config includes unwritten, implicit configuration defaults.
      # Changes to those values may cause differences in behavior.
      icount=100000
      random_range=1000000000
      range_partition=false
      table_count=200
      report_interval=1
      run_time=2000
      populate_threads=1
      threads=((count=12,inserts=1),(count=3,reads=1))
      max_latency=2000
      sample_interval=5
      verbose=2
      conn_config=",,,,"
      table_config=",,,"
      

            Assignee:
            sulabh.mahajan@mongodb.com Sulabh Mahajan
            Reporter:
            sulabh.mahajan@mongodb.com Sulabh Mahajan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: