Skip to content

MySQL Primary Keys - v1.15 breaks compliance with Percona Strict Mode #17017

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

Closed
2 of 6 tasks
tacerus opened this issue Sep 11, 2021 · 4 comments
Closed
2 of 6 tasks

MySQL Primary Keys - v1.15 breaks compliance with Percona Strict Mode #17017

tacerus opened this issue Sep 11, 2021 · 4 comments

Comments

@tacerus
Copy link

tacerus commented Sep 11, 2021

  • Gitea version (or commit ref): v1.15.2 (binary release)
  • Git version: 2.31.1
  • Operating system: openSUSE 15.3
  • Database (use [x]):
    • PostgreSQL
    • MySQL (Percona XtraDB Cluster)
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:

Description

Hello,

Thanks for the great software! :-)

We have been using Gitea with a Percona MySQL database and pxc_strict_mode set to ENFORCING (a Percona XtraDB setting for MySQL that, beneath other checks, blocks transactions lacking primary keys on tables - this is important, as such transactions can cause issues with the mechanism that propagates write operations to other cluster nodes) since a long time, and it has always been working fantastically. With v1.15 however, there seems to be an issue with missing primary keys in the database. as i.e. the creation of an issue will return a 500 error page, with log entries like the following example being generated:

2021/09/11 02:26:06 ...rs/web/repo/issue.go:980:NewIssuePost() [E] NewIssue: generate issue index failed: Error 1105: Percona-XtraDB-Cluster prohibits use of DML command on a table (gitea.issue_index) without an explicit primary key with pxc_strict_mode = ENFORCING or MASTER

For now we have the database servers in PERMISSIVE mode, in order for Gitea to be able to operate, however as the database cluster is in use with other services as well, this is not an ideal scenario.
I understand if Percona's distribution of MySQL is not a common use case, however would very much appreciate if the support of it could be considered as a request, or if short instructions on how to manually update the tables in the new version in order for them to include primary keys again could be provided.

Best,
Georg

@lunny
Copy link
Member

lunny commented Sep 11, 2021

I think this has been resolved by #16820 which published in 1.15.1

@tacerus
Copy link
Author

tacerus commented Sep 11, 2021

Thanks for the input! The text suggests it will ship with 1.16, but that a user on 1.15 can use gitea doctor recreate-table issue_index - does this apply to 1.15.2 as well?

@zeripath
Copy link
Contributor

Yes it applies to 1.15.2. Just run the doctor command.

(If you had upgraded straight to 1.15.2 instead of going via 1.15.0 you would not have hit this problem. Did you ever run 1.15.0?)

@tacerus
Copy link
Author

tacerus commented Sep 11, 2021

Thank you very much! That worked perfectly. I upgraded directly to 1.15.2 this time, however had a failed attempt on 1.15.0 before I downgraded back to 1.14.x - there might have been some leftovers there.

@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants