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:
- A persisted execution id. It is stored, not recomputed on read.
- 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
- 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.
- 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.
- 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.
- What breaks in between? During the cutover the database holds slugs and the code may still hold URIs, or the reverse. Decide the order.
- Does anything outside
mint-ensemble-manager read the hash? Check ui-react and ui for a stored execution id.
Answer must record
Part of #126
Question
Changing the
idinvalidates 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:The MD5 seed starts with
execution.modelid, a fullw3idURI today. The hash is two things at once:getMatchingExecutioncompares a fresh hash against stored hashes.When
modelidbecomes a slug, every fresh hash differs from every stored hash. Nothing matches.Production holds 234
executionrows and 42thread_model_executionrows. See #127.Points to settle
execution.idand every FK that points at it.modelidmakes the hash immune to this change and to the next one.mint-ensemble-managerread the hash? Checkui-reactanduifor a stored execution id.Answer must record
execution.idis rewritten, and the migration that does it.