Skip to content

Decide what happens to persisted execution hashes when the id changes #133

Description

@mosoriob

Part of #126

Question

Changing the id invalidates every persisted execution hash. What happens to existing executions?

Map Decision 3 says existing threads and executions must continue to work. This ticket decides how.

The mechanism

mint-ensemble-manager/src/classes/graphql/graphql_functions.ts:469:

export const getExecutionHash = (execution: Execution): string => {
    let str = execution.modelid;
    const varids = Object.keys(execution.bindings).sort();
    varids.map((varid) => { ... str += varid + "=" + bindingid + "&"; });
    return Md5.hashStr(str).toString();
};

The MD5 seed starts with execution.modelid, a full w3id URI today. The hash is two things at once:

  1. A persisted execution id. It is stored, not recomputed on read.
  2. The run-dedup key. getMatchingExecution compares a fresh hash against stored hashes.

When modelid becomes a slug, every fresh hash differs from every stored hash. Nothing matches.

Production holds 234 execution rows and 42 thread_model_execution rows. See #127.

Points to settle

  1. Do stored hashes get rewritten? The hash is derivable, so a migration can recompute it. That means rewriting execution.id and every FK that points at it.
  2. Or does the seed stop using the raw id? Seeding with a stable key instead of modelid makes the hash immune to this change and to the next one.
  3. Or is a one-time dedup miss acceptable? Every past execution re-runs once. Cheapest to build, most expensive to run. Size it against the 234 rows.
  4. What breaks in between? During the cutover the database holds slugs and the code may still hold URIs, or the reverse. Decide the order.
  5. Does anything outside mint-ensemble-manager read the hash? Check ui-react and ui for a stored execution id.

Answer must record

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wayfinder:grillingWayfinder ticket: decision reached by conversation (HITL)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions