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

Implement dynamic table creation in workgen

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • WT11.2.0, 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • 5
    • Storage Engines - 2022-12-12

      Usually, in Workgen tables are created at the start and then a workload is executed on them (see example_simple.py).

      As part of PM-2712, one of the requirements is to continuously create tables, even after the workload has started.

      This ticket needs to update Workgen so a new table can be added/visible to the internal variables in Workgen at any time. This could be a simple API called add_table. The Python interface should be updated as well.

      There are a set of internal variables in Workgen related to the existing tables:

      // A 'tint' or ('table integer') is a unique small value integer
      // assigned to each table URI in use.  Currently, we assign it once,
      // and its value persists through the lifetime of the Context.
      typedef uint32_t tint_t;
      ...
          std::map<tint_t, uint32_t> _table_usage;       // value is Usage
          WT_CURSOR **_cursors;                          // indexed by tint_t
      ...
          std::map<std::string, tint_t> _tint;           // maps uri -> tint_t
          std::map<tint_t, std::string> _table_names;    // reverse mapping
          TableRuntime *_table_runtime;                  // # entries per tint_t
          uint32_t _runtime_alloced;                     // length of _table_runtime
          tint_t _tint_last;                             // last tint allocated
      

      All those should be updated safely and for this purpose, a locking mechanism should be implemented.

            Assignee:
            etienne.petrel@mongodb.com Etienne Petrel
            Reporter:
            etienne.petrel@mongodb.com Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: