Skip to content

Conversation

@joshtrichards
Copy link
Member

Summary

We fail silently and/or break part way through conversions in some cases in unusual ways.

Why? The current resync code needs additional error checking.

Additionally we also retrieve things in some semi-brittle ways.

This PR:

  • makes all known failure scenarios explicitly throw (multiple sequence owners, no sequence owners, insufficient privileges)
  • introduces more robust ways of retrieving sequence owners and setting sequence values (with fall back behavior)
  • hardens binding / identifier handling to make a bit more resilient

Tried to keep business logic manageable/readable by introducing changes via smaller/dedicated helpers.

BREAKING CHANGE: resynchronizeDatabaseSequences now fails fast for sequences with no owner or multiple owners and requires UPDATE privilege (or ownership) to set sequences; callers that relied on the previous silent (or unpredictable) behavior should be aware these invalid states are now detected.

It'd be nice to add some unit / integration / e2e tests for the DB converter. AFAIK there aren't any currently.

TODO

Checklist

Signed-off-by: Josh <josh.t.richards@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Conversion of MariaDB to Postgres17 fails on oc_storages_numeric_id_seq sequence

2 participants