Skip to content

Remove two orphaned modeling rows left at TACC by the #116 verification #120

Description

@mosoriob

Part of #79

Question

Remove two orphaned modeling rows from TACC's production database. They cannot be deleted from the app.

Why the app cannot do it

They were created while verifying #116, and deleted with the old client, which removes the CREATE provenance before the row. That provenance is the user delete permission, so the rows survive with no owner. mosorio cannot see them; anonymous can. The fixed client (#115) cannot delete them either — the permission it needs is already gone.

Same state as the #92 orphan. Fold that one in if its ids are to hand.

problem_statement task thread
dqu2ft1qmsnwzf7l ck7ck3zwmsnwzfsi l7gs1mozmsnwzg27
dkgbvxpzmsnx9u6o 1ier73rsmsnx9uy8 5wjaat9bmsnx9v7y

Both are named DELETE TEST #116 .... Neither carries a thread_model, dataslice or thread_data — every one of those root fields reported affected_rows 0.

SQL

Needs the admin secret or direct psql. Bottom-up, because the structural FKs are not cascading — only the six provenance and permission FKs are, and those clean themselves up when the parent goes.

BEGIN;

DELETE FROM thread
 WHERE task_id IN (
   SELECT id FROM task
    WHERE problem_statement_id IN ('dqu2ft1qmsnwzf7l', 'dkgbvxpzmsnx9u6o')
 );

DELETE FROM task
 WHERE problem_statement_id IN ('dqu2ft1qmsnwzf7l', 'dkgbvxpzmsnx9u6o');

DELETE FROM problem_statement
 WHERE id IN ('dqu2ft1qmsnwzf7l', 'dkgbvxpzmsnx9u6o');

COMMIT;

Expect 2 rows from each statement. Check for a long-lived transaction first — see docs/runbook-116-cascade-migration.md step 1c and #119.

Verify

Anonymously, no token:

curl -s https://graphql.mint.tacc.utexas.edu/v1/graphql \
  -H 'Content-Type: application/json' \
  -d '{"query":"{ problem_statement(where: {name: {_ilike: \"%DELETE TEST #116%\"}}) { id name } }"}'

Must return an empty list. anonymous is the role that can see these, so this is the check that counts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    wayfinder:taskWayfinder ticket: manual work that unblocks a decision

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions