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

Document SchemaManager #2925

Merged
merged 6 commits into from
Aug 16, 2020
Merged

Document SchemaManager #2925

merged 6 commits into from
Aug 16, 2020

Conversation

xeruf
Copy link
Contributor

@xeruf xeruf commented Jul 8, 2020

While working on understanding it, I wrote some documentation and tried to reduce in-code comments.
This also serves as feedback whether I understood it correctly.

@Be-ing Be-ing requested a review from uklotzde July 8, 2020 22:12
@xeruf
Copy link
Contributor Author

xeruf commented Jul 9, 2020

@uklotzde better now? :)

src/database/schemamanager.h Outdated Show resolved Hide resolved
if (backwardsCompatibleVersion.isNull() || !ok) {
// rryan 11/2010 We just added the backwards compatible flags, and some
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did your removed this part??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's an exception for an ancient version we definitely don't support anymore.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Holzhaus Why has this been merged? It is not possible to revoke a database version once it has been released. All exceptions in the upgrade path must be preserved forever.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is why I asked and expressed my concerns about this removal.

Copy link
Contributor

Choose a reason for hiding this comment

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

@xerus2000 Unfortunately you not only documented the SchemaManager as advertised but slipped in functional changes. That's the main reason why I don't trust your "cleanup" PRs that might contain some hidden changes as this one.

Copy link
Member

@Holzhaus Holzhaus Aug 16, 2020

Choose a reason for hiding this comment

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

This would only affect people on schema version 7 and want to downgrade to schema version 3 which isn't possible with the current Mixxx anyway, right? So you'd need to grab an old version of Mixxx, and in that case the code is still there. Or am I missing something?

Copy link
Member

Choose a reason for hiding this comment

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

Anyway, I'll revert that change.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am also not sure. Whoever is removing this code should is in charge to explain in detail why this removal cannot affect any users of Mixxx. I'm not planning to remove this code, so I don't need to think about it. As simple as that.

Copy link
Member

Choose a reason for hiding this comment

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

I reverted it: a0e1228

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This only affected developers of mixxx who were using mixxx in a narrow timespan where schema version 7 was released without a min_compatible flag. Every version of mixxx you can get now includes the min_compatible flag in version 7, so this is superfluous. It is just confusing when reading the code and carries no use for anyone anymore. It is dead code.

bool isBackwardsCompatibleWithVersion(int targetVersion) const;

/// Does nothing if the versions are incompatible or the targetVersion is
Copy link
Contributor

Choose a reason for hiding this comment

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

"Tries to update the database schema to targetVersion. Pending changes are rolled back upon failure."

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 thought you didn't want to repeat the signature in words, and isn't that the first sentence?

Copy link
Contributor

Choose a reason for hiding this comment

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

Do whatever you think is right. I am out.

@@ -26,8 +29,15 @@ class SchemaManager {
return m_currentVersion;
}

/// If the current version has no backwards compatibility info, it is
Copy link
Contributor

Choose a reason for hiding this comment

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

Please omit the implementation details: "Checks if the current schema version is backwards compatible with the given targetVersion."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But this "implementation detail" is extremely important, especially if you write a new schema revision. I wouldn't consider this a "detail", rather an essential information about the logic.

@uklotzde
Copy link
Contributor

uklotzde commented Jul 9, 2020

I am not reviewing this PR any longer. Maybe I am biased. Someone else may take over.

@xeruf
Copy link
Contributor Author

xeruf commented Jul 9, 2020

Sorry if I am annoying you @uklotzde - I have actually implemented the changes you requested as far as I am aware, I am just trying to understand them as well :)

@xeruf xeruf requested a review from Holzhaus July 14, 2020 08:52
src/database/schemamanager.cpp Show resolved Hide resolved
src/database/schemamanager.cpp Outdated Show resolved Hide resolved
@Holzhaus
Copy link
Member

Holzhaus commented Aug 7, 2020

@uklotzde Okay to merge or do we need more changes?

@xeruf xeruf requested review from Holzhaus and uklotzde August 7, 2020 12:58
@Holzhaus Holzhaus merged commit 57abee5 into mixxxdj:master Aug 16, 2020
Holzhaus added a commit to Holzhaus/mixxx that referenced this pull request Aug 16, 2020
@xeruf xeruf mentioned this pull request Aug 29, 2020
13 tasks
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.

None yet

3 participants