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

Unified Storage: create kind_version table migration, add SQL and fix db #87977

Conversation

diegommm
Copy link
Contributor

@diegommm diegommm commented May 16, 2024

What is this feature?

  1. Add a migration to create the kind_version table.
  2. Add all the SQL templates.
  3. Add the possibility to change the isolation level in which a transaction is run.

Why do we need this feature?

To implement Proposal 1 for Consistent Resource Version.

Who is this feature for?

Everyone

Which issue(s) does this PR fix?:

None

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@diegommm diegommm self-assigned this May 16, 2024
@grafana-delivery-bot grafana-delivery-bot bot added this to the 11.1.x milestone May 16, 2024
@diegommm diegommm added go Pull requests that update Go code no-changelog Skip including change in changelog/release notes labels May 16, 2024
@diegommm diegommm force-pushed the search-and-storage-issue-28-consistent-resource-version-proposal-1-pr3 branch from 613933c to b5c8432 Compare May 16, 2024 14:29
@@ -0,0 +1,59 @@
package dbimpl
Copy link
Contributor Author

@diegommm diegommm May 16, 2024

Choose a reason for hiding this comment

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

We need these changes to be able to execute in different isolation levels.

@diegommm diegommm changed the title fix database interfaces Unified Storage: create kind_version table migration, add SQL and fix db May 16, 2024
@diegommm diegommm marked this pull request as ready for review May 16, 2024 16:31
@diegommm diegommm requested review from a team as code owners May 16, 2024 16:32
LIMIT 1
{{ end }}

{{ if .SelectForUpdate }}
Copy link
Contributor

Choose a reason for hiding this comment

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

from pairing session: add no wait

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will be added in the followup PR.

(
{{ .Ident "group" }},
{{ .Ident "resource" }},
{{ .Ident "resource_version" }}
Copy link
Contributor

Choose a reason for hiding this comment

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

from pairing session: possibly add updated_at

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed! Added created_at as well for completeness, doesn't hurt and might be useful in the future. Note that I cannot add the proper DEFAULT to set the current timestamp because that is SQL-Dialect dependent, so I will change the corresponding SQL templates in the upcoming PRs.

@diegommm diegommm merged commit 8b02b6b into main May 22, 2024
13 checks passed
@diegommm diegommm deleted the search-and-storage-issue-28-consistent-resource-version-proposal-1-pr3 branch May 22, 2024 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backend/db/migration area/backend go Pull requests that update Go code no-changelog Skip including change in changelog/release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants