Page MenuHomePhabricator

Avoid depooling hosts if the schema change has been applied before
Open, MediumPublic

Description

It should simply detect+skip that host before attempting to depool it.

Details

Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
schema_change_helper: filter TODO replicasrepos/sre/schema-changes!65fcerattoT299441-2T423841
Tidy up importsrepos/data_persistence/dbtools/auto_schema!20fcerattoT299441-5main
Support setting replicas from CLIrepos/data_persistence/dbtools/auto_schema!19fcerattoT299441-4main
Draft: Depool hosts only when needed based on check()repos/data_persistence/dbtools/auto_schema!14fcerattoT299441-3main
Add planning functionrepos/data_persistence/dbtools/auto_schema!7fcerattoT299441main
Customize query in GitLab

Event Timeline

Ladsgroup moved this task from Triage to Ready on the DBA board.
Marostegui raised the priority of this task from Low to Medium.Jan 24 2022, 10:44 AM

I am going to give this medium priority instead of low as it can be very useful if a schema change needs to be retried on an entire section (ie: some hosts failed to depool, you might just want to simply run the schema change on the entire section instead of having to check+target specific hosts)

@FCeratto-WMF this is something I'd like you to tackle also once @Ladsgroup has gotten you into the wonderful world of schema changes.

@FCeratto-WMF currently, the schema change script works this way:

  • Depool a host
  • Check if the schema change is applied
    • if not -> run in -> repool the host in 5 steps
    • if yes -> skip schema change -> repool the in 5 steps.

Ideally, the script should check if the schema change is applied (this is a safe operation and won't imply any peformance penalty) and if it is not applied, then depool, run and repool.
Let me know if this gives you enough context or you'd need more details.

As requested by @Ladsgroup I moved the tool to https://gitlab.wikimedia.org/repos/data_persistence/dbtools/auto_schema - we also discussed adding tests, type hints, and fixing any bug that comes up that might impact the depool/repool process as we don't have any way to do real end-to-end testing.

As discussed during the meeting - let's do:

  1. Use the wrapper at https://gitlab.wikimedia.org/repos/sre/schema-changes/-/merge_requests/42 (which needs to be merged)
  2. Document the way to run schema changes with the helper (which will populate zarcillo)
  3. Add a flag for the current auto_schema to pass the list of hosts that need the schema change

Mentioned in SAL (#wikimedia-operations) [2025-11-19T13:33:59Z] <marostegui@cumin1003> dbctl commit (dc=all): 'Depooling db1187 (T299441)', diff saved to https://phabricator.wikimedia.org/P85388 and previous config saved to /var/cache/conftool/dbconfig/20251119-133358-marostegui.json

Mentioned in SAL (#wikimedia-operations) [2025-11-24T11:21:11Z] <marostegui@cumin1003> dbctl commit (dc=all): 'Depooling db1187 (T299441)', diff saved to https://phabricator.wikimedia.org/P85504 and previous config saved to /var/cache/conftool/dbconfig/20251124-112111-marostegui.json

Mentioned in SAL (#wikimedia-operations) [2025-11-24T11:28:50Z] <marostegui@cumin1003> dbctl commit (dc=all): 'Depooling db1187 (T299441)', diff saved to https://phabricator.wikimedia.org/P85509 and previous config saved to /var/cache/conftool/dbconfig/20251124-112850-marostegui.json

Mentioned in SAL (#wikimedia-operations) [2025-11-25T14:08:10Z] <fceratto@cumin1003> dbctl commit (dc=all): 'Depooling db1187 (T299441)', diff saved to https://phabricator.wikimedia.org/P85617 and previous config saved to /var/cache/conftool/dbconfig/20251125-140809-fceratto.json

Mentioned in SAL (#wikimedia-operations) [2025-11-25T15:20:32Z] <fceratto@cumin1003> dbctl commit (dc=all): 'Depooling db1187 (T299441)', diff saved to https://phabricator.wikimedia.org/P85636 and previous config saved to /var/cache/conftool/dbconfig/20251125-152031-fceratto.json

Mentioned in SAL (#wikimedia-operations) [2025-11-27T10:39:02Z] <fceratto@cumin1003> dbctl commit (dc=all): 'Depooling db1187 (T299441)', diff saved to https://phabricator.wikimedia.org/P85838 and previous config saved to /var/cache/conftool/dbconfig/20251127-103901-fceratto.json