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 parallelly generating index failure with Mysql #24567

Merged
merged 23 commits into from
Jun 5, 2023

Conversation

lunny
Copy link
Member

@lunny lunny commented May 6, 2023

  • Fix possible parallel creating commit status index problem and creating issues/pull request index problem work with Mysql5/Mysql8
  • Add parallel tests
  • Reenable TestRepoCommitsStatusParallel on CI

Fix #22109

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 6, 2023
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label May 6, 2023
@a1012112796
Copy link
Member

wonder why not directly using SELECT MAX(indx) FROM commit_status WHERE ... ?

@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 16, 2023
@lunny
Copy link
Member Author

lunny commented Jun 3, 2023

wonder why not directly using SELECT MAX(indx) FROM commit_status WHERE ... ?

That may result in two commit_status having the same index.

@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 3, 2023
@lunny lunny marked this pull request as ready for review June 3, 2023 16:03
@lunny lunny added type/bug outdated/backport/v1.19 This PR should be backported to Gitea 1.19 labels Jun 3, 2023
@lunny lunny added this to the 1.20.0 milestone Jun 3, 2023
models/db/index.go Outdated Show resolved Hide resolved
@lunny lunny changed the title Test: Add more context on log for generating parall commit status index Fix parallelly generating index failure with Mysql Jun 4, 2023
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 4, 2023
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 5, 2023
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jun 5, 2023
@lunny lunny enabled auto-merge (squash) June 5, 2023 10:08
@lunny lunny merged commit 315124b into go-gitea:main Jun 5, 2023
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Jun 5, 2023
@GiteaBot GiteaBot added backport/done All backports for this PR have been created and removed reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. labels Jun 5, 2023
techknowlogick pushed a commit that referenced this pull request Jun 5, 2023
Backport #24567 by @lunny

- Fix possible parallel creating commit status index problem and
creating issues/pull request index problem work with Mysql5/Mysql8
- Add parallel tests
- Reenable TestRepoCommitsStatusParallel on CI

Fix #22109

---------

Co-authored-by: Lunny Xiao <[email protected]>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jun 6, 2023
* upstream/main: (26 commits)
  Clean up WebAuthn javascript code and remove JQuery code (go-gitea#22697)
  Enable all webpack sourcemaps in dev build, disable all in prod build (go-gitea#25089)
  Don't display `select all issues` checkbox when no issues are available (go-gitea#25086)
  change placeholders in actions docs
  change placeholders in actions docs
  fix "Remove stars when repo goes private go-gitea#19904" (go-gitea#25084)
  Introduce how to configure cache when starting a Runner with Docker (go-gitea#25077)
  Remove stars when repo goes private (go-gitea#19904)
  Use correct selector for hiding RSS icon link in the branch selector dropdown (go-gitea#25080)
  Fix parallelly generating index failure with Mysql (go-gitea#24567)
  Use git command instead of the ini package to remove the `origin` remote (go-gitea#25066)
  improve permission documentation (go-gitea#23942)
  Use RepositoryList instead of []*Repository (go-gitea#25074)
  Add ability to set multiple redirect URIs in OAuth application UI (go-gitea#25072)
  Add Progressbar to Milestone Page (go-gitea#25050)
  [skip ci] Updated licenses and gitignores
  Redesign Scoped Access Tokens (go-gitea#24767)
  Use a separate admin page to show global stats, remove `actions` stat (go-gitea#25062)
  Remove cancel button from branch protection form (go-gitea#25063)
  Allow for PKCE flow without client secret + add docs (go-gitea#25033)
  ...
Codeberg-org pushed a commit to Codeberg-org/gitea that referenced this pull request Jun 23, 2023
…o-gitea#25081)

Backport go-gitea#24567 by @lunny

- Fix possible parallel creating commit status index problem and
creating issues/pull request index problem work with Mysql5/Mysql8
- Add parallel tests
- Reenable TestRepoCommitsStatusParallel on CI

Fix go-gitea#22109

---------

Co-authored-by: Lunny Xiao <[email protected]>
(cherry picked from commit 3ef9793)
@lunny lunny deleted the lunny/fix_parall_commit_status_index branch August 24, 2023 12:45
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Sep 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. outdated/backport/v1.19 This PR should be backported to Gitea 1.19 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky test: TestRepoCommitsStatusParallel
5 participants