Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞 Fix db config persistence unique constraint conflict #5846

Merged
merged 12 commits into from
Sep 4, 2021

Conversation

tuliren
Copy link
Contributor

@tuliren tuliren commented Sep 4, 2021

What

@tuliren tuliren changed the title Liren/fix db config persistence conflict 🐞 Fix db config persistence unique constraint conflict Sep 4, 2021
@tuliren tuliren force-pushed the liren/fix-db-config-persistence-conflict branch from f3053a7 to cbb15fd Compare September 4, 2021 18:43
@tuliren tuliren merged commit 6e35dc5 into master Sep 4, 2021
@tuliren tuliren deleted the liren/fix-db-config-persistence-conflict branch September 4, 2021 19:46
@@ -364,7 +358,8 @@ void updateConfigsFromSeed(DSLContext ctx, ConfigPersistence seedConfigPersisten
* repository name instead of definition id because connectors can be added manually by
* users, and are not always the same as those in the seed.
*/
private Map<String, ConnectorInfo> getConnectorRepositoryToInfoMap(DSLContext ctx) {
@VisibleForTesting
Map<String, ConnectorInfo> getConnectorRepositoryToInfoMap(DSLContext ctx) {
Copy link
Contributor

@sherifnada sherifnada Sep 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this return the info keyed by definition? connector repository is not guaranteed to be a primary key. Or at least maybe it should return a multimap?

Copy link
Contributor Author

@tuliren tuliren Sep 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we cannot key it by definition. The purpose is to upgrade the connector version, and the version is included in the definition. If we key by definition, we cannot check which definition needs the upgrade efficiently.

Why the connector repository is not unique? Do we allow multiple versions of repos in the same workspace? That seems chaotic.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair points, let's resolve after the weekend. Enjoy the long weekend!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it also makes sense for different connectors to have the same repository with different names. In that case, I can change it to a multi-map.

Sure, this can wait after the weekend.

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.

2 participants