test_model_workload's known-issue retry loop regenerates an identical workload

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor - P4
    • WT12.0.0, 9.1.0-rc0
    • Affects Version/s: None
    • Component/s: Test Model
    • None
    • Storage Engines - Persistence
    • 50.043
    • SE Persistence backlog
    • None

      Issue Summary

      test_workload_generator() in test/model/test/model_workload/main.cpp retries up to 11 times when workload verification throws known_issue_exception, but every attempt regenerates the byte-identical workload. The retry can therefore never succeed: if the workload trips the known issue once, it trips it all 11 times and the test fails with the misleading Too many retries for workload generation rather than the underlying issue.

      while (true) {
          try {
              model::kv_workload_generator_spec spec;
              spec.disaggregated = 0;
      
              std::shared_ptr<model::kv_workload> workload =
                model::kv_workload_generator::generate(spec);   <-- seed defaults to 0 every pass
              ...
              break;
          } catch (model::known_issue_exception &) {
              /* Try again. */
          }
      
          if (retries++ > 10)
              throw model::model_exception("Too many retries for workload generation");
      }
      

      Context

      • generate(spec) takes uint64_t seed = 0, and model::random seeds deterministically via __wt_random_init_seed(), so seed 0 always yields the same workload. Nothing in the loop varies between attempts.
      • The exception it retries on is known_issue_exception("WT-13232"), thrown from the truncate path in kv_table.cpp when a key adjacent to the truncate range belongs to a prepared transaction. It is a property of the generated workload, so regenerating the same workload reproduces it deterministically.
      • model_test (the tool) gets this right for comparison: its loop advances the seed with model::random::next_seed() each iteration, so a workload that trips the known issue is followed by a different one.
      • Latent today — the workload at seed 0 does not currently trip WT-13232, or the test would always fail. It becomes a hard, confusingly-reported CI failure the moment a change to the default spec or to the generation algorithm makes seed 0 produce a triggering workload.
      • Found while reviewing the generate() callers for WT-18363; unrelated to that fix.

      Proposed Solution

      • Vary the seed across attempts in test_workload_generator(), following the model_test pattern: hold a seed variable and advance it with model::random::next_seed() before each retry, passing it as generate(spec, seed).
      • Consider reporting the known issue's identifier (e.issue()) in the "too many retries" message so an exhausted retry budget names what was actually hit.

      Definition of done

      • Consecutive attempts in the retry loop generate different workloads.
      • A workload that trips a known issue is followed by a different workload rather than an identical one.

            Assignee:
            Etienne Petrel
            Reporter:
            Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: