Skip to content

Primary key required in MySQL DB clusters  #16802

@aqos156

Description

@aqos156
  • Gitea version (or commit ref): gitea/gitea:1.15.0
  • Git version: -
  • Operating system: Linux (docker)
  • Database (use [x]):
    • PostgreSQL
      MySQL
      MSSQL
      SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
      No
  • Log gist:
    ORM engine initialization attempt #1/10 failed. Error: migrate: do migrate: Error 3750: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

Description

Certain DB clusters (for example DigitalOcean's MySQL cluster) require the use of primary keys which until now was fine. It seems like this support was dropped since 1.15. This issue occurs at fresh installation of 1.15 and also when upgrading from 1.14

Activity

lunny

lunny commented on Aug 24, 2021

@lunny
Member

Could you give more logs, if you can enable log level to info, some information like Migration[%d]: %s should be above the error line.

aqos156

aqos156 commented on Aug 24, 2021

@aqos156
Author

@lunny log level is set to info in conf and this is the output of a fresh installation:

Server listening on :: port 22.

Server listening on 0.0.0.0 port 22.

2021/08/24 13:17:13 cmd/web.go:97:runWeb() [I] Starting Gitea on PID: 17

2021/08/24 13:17:13 cmd/web.go:141:runWeb() [I] Global init

2021/08/24 13:17:13 routers/init.go:74:GlobalInit() [I] Git Version: 2.30.2, Wire Protocol Version 2 Enabled

2021/08/24 13:17:13 routers/init.go:77:GlobalInit() [I] AppPath: /app/gitea/gitea

2021/08/24 13:17:13 routers/init.go:78:GlobalInit() [I] AppWorkPath: /app/gitea

2021/08/24 13:17:13 routers/init.go:79:GlobalInit() [I] Custom path: /data/gitea

2021/08/24 13:17:13 routers/init.go:80:GlobalInit() [I] Log path: /data/gitea/log

2021/08/24 13:17:13 routers/init.go:81:GlobalInit() [I] Run Mode: Prod

2021/08/24 13:17:14 ...dules/setting/log.go:286:newLogService() [I] Gitea v1.15.0 built with GNU Make 4.3, go1.16.7 : bindata, timetzdata, sqlite, sqlite_unlock_notify

2021/08/24 13:17:14 ...dules/setting/log.go:333:newLogService() [I] Gitea Log Mode: Console(Console:)

2021/08/24 13:17:14 ...dules/setting/log.go:249:generateNamedLogger() [I] Router Log: Console(console:)

2021/08/24 13:17:14 ...les/setting/cache.go:78:newCacheService() [I] Cache Service Enabled

2021/08/24 13:17:14 ...les/setting/cache.go:93:newCacheService() [I] Last Commit Cache Service Enabled

2021/08/24 13:17:14 ...s/setting/session.go:77:newSessionService() [I] Session Service Enabled

2021/08/24 13:17:14 ...s/storage/storage.go:170:initAttachments() [I] Initialising Attachment storage with type: 

2021/08/24 13:17:14 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/attachments

2021/08/24 13:17:14 ...s/storage/storage.go:164:initAvatars() [I] Initialising Avatar storage with type: 

2021/08/24 13:17:14 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/avatars

2021/08/24 13:17:14 ...s/storage/storage.go:182:initRepoAvatars() [I] Initialising Repository Avatar storage with type: 

2021/08/24 13:17:14 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/repo-avatars

2021/08/24 13:17:14 ...s/storage/storage.go:176:initLFS() [I] Initialising LFS storage with type: 

2021/08/24 13:17:14 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/git/lfs

2021/08/24 13:17:14 ...s/storage/storage.go:188:initRepoArchives() [I] Initialising Repository Archive storage with type: 

2021/08/24 13:17:14 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/repo-archive

2021/08/24 13:17:14 routers/init.go:93:GlobalInit() [I] SQLite3 Supported

2021/08/24 13:17:14 routers/common/db.go:20:InitDBEngine() [I] Beginning ORM engine initialization.

2021/08/24 13:17:14 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #1/10...

2021/08/24 13:17:14 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mysql

2021/08/24 13:17:18 routers/common/db.go:33:InitDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: sync database struct error: Error 3750: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

2021/08/24 13:17:18 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds

2021/08/24 13:17:21 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #2/10...

2021/08/24 13:17:21 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mysql

2021/08/24 13:17:22 routers/common/db.go:33:InitDBEngine() [E] ORM engine initialization attempt #2/10 failed. Error: sync database struct error: Error 3750: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

2021/08/24 13:17:22 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds

2021/08/24 13:17:25 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #3/10...

2021/08/24 13:17:25 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mysql

2021/08/24 13:17:25 routers/common/db.go:33:InitDBEngine() [E] ORM engine initialization attempt #3/10 failed. Error: sync database struct error: Error 3750: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

2021/08/24 13:17:25 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds

2021/08/24 13:17:28 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #4/10...

2021/08/24 13:17:28 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mysql

2021/08/24 13:17:29 routers/common/db.go:33:InitDBEngine() [E] ORM engine initialization attempt #4/10 failed. Error: sync database struct error: Error 3750: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

2021/08/24 13:17:29 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds

2021/08/24 13:17:32 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #5/10...

2021/08/24 13:17:32 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mysql

2021/08/24 13:17:32 routers/common/db.go:33:InitDBEngine() [E] ORM engine initialization attempt #5/10 failed. Error: sync database struct error: Error 3750: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

2021/08/24 13:17:32 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds

2021/08/24 13:17:35 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #6/10...

2021/08/24 13:17:35 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mysql

2021/08/24 13:17:35 routers/common/db.go:33:InitDBEngine() [E] ORM engine initialization attempt #6/10 failed. Error: sync database struct error: Error 3750: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

2021/08/24 13:17:35 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds

2021/08/24 13:17:38 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #7/10...

2021/08/24 13:17:38 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mysql

2021/08/24 13:17:39 routers/common/db.go:33:InitDBEngine() [E] ORM engine initialization attempt #7/10 failed. Error: sync database struct error: Error 3750: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

2021/08/24 13:17:39 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds

2021/08/24 13:17:42 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #8/10...

2021/08/24 13:17:42 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mysql

2021/08/24 13:17:42 routers/common/db.go:33:InitDBEngine() [E] ORM engine initialization attempt #8/10 failed. Error: sync database struct error: Error 3750: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

2021/08/24 13:17:42 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds

2021/08/24 13:17:45 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #9/10...

2021/08/24 13:17:45 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mysql

2021/08/24 13:17:46 routers/common/db.go:33:InitDBEngine() [E] ORM engine initialization attempt #9/10 failed. Error: sync database struct error: Error 3750: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

2021/08/24 13:17:46 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds

2021/08/24 13:17:49 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #10/10...

2021/08/24 13:17:49 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mysql

2021/08/24 13:17:49 routers/init.go:100:GlobalInit() [F] ORM engine initialization failed: sync database struct error: Error 3750: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

Received signal 15; terminating.

And this is log of migration from 1.14:

Server listening on :: port 22.

Server listening on 0.0.0.0 port 22.

2021/08/24 13:10:45 cmd/web.go:97:runWeb() [I] Starting Gitea on PID: 16

2021/08/24 13:10:45 cmd/web.go:141:runWeb() [I] Global init

2021/08/24 13:10:45 routers/init.go:74:GlobalInit() [I] Git Version: 2.30.2, Wire Protocol Version 2 Enabled

2021/08/24 13:10:45 routers/init.go:77:GlobalInit() [I] AppPath: /app/gitea/gitea

2021/08/24 13:10:45 routers/init.go:78:GlobalInit() [I] AppWorkPath: /app/gitea

2021/08/24 13:10:45 routers/init.go:79:GlobalInit() [I] Custom path: /data/gitea

2021/08/24 13:10:45 routers/init.go:80:GlobalInit() [I] Log path: /data/gitea/log

2021/08/24 13:10:45 routers/init.go:81:GlobalInit() [I] Run Mode: Prod

2021/08/24 13:10:45 ...dules/setting/log.go:286:newLogService() [I] Gitea v1.15.0 built with GNU Make 4.3, go1.16.7 : bindata, timetzdata, sqlite, sqlite_unlock_notify

2021/08/24 13:10:45 ...dules/setting/log.go:333:newLogService() [I] Gitea Log Mode: Console(Console:)

2021/08/24 13:10:45 ...dules/setting/log.go:249:generateNamedLogger() [I] Router Log: Console(console:)

2021/08/24 13:10:45 ...les/setting/cache.go:78:newCacheService() [I] Cache Service Enabled

2021/08/24 13:10:45 ...les/setting/cache.go:93:newCacheService() [I] Last Commit Cache Service Enabled

2021/08/24 13:10:45 ...s/setting/session.go:77:newSessionService() [I] Session Service Enabled

2021/08/24 13:10:45 ...s/storage/storage.go:170:initAttachments() [I] Initialising Attachment storage with type: 

2021/08/24 13:10:45 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/attachments

2021/08/24 13:10:45 ...s/storage/storage.go:164:initAvatars() [I] Initialising Avatar storage with type: 

2021/08/24 13:10:45 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/avatars

2021/08/24 13:10:45 ...s/storage/storage.go:182:initRepoAvatars() [I] Initialising Repository Avatar storage with type: 

2021/08/24 13:10:45 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/repo-avatars

2021/08/24 13:10:45 ...s/storage/storage.go:176:initLFS() [I] Initialising LFS storage with type: 

2021/08/24 13:10:45 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/git/lfs

2021/08/24 13:10:45 ...s/storage/storage.go:188:initRepoArchives() [I] Initialising Repository Archive storage with type: 

2021/08/24 13:10:45 ...les/storage/local.go:47:NewLocalStorage() [I] Creating new Local Storage at /data/gitea/repo-archive

2021/08/24 13:10:45 routers/init.go:93:GlobalInit() [I] SQLite3 Supported

2021/08/24 13:10:45 routers/common/db.go:20:InitDBEngine() [I] Beginning ORM engine initialization.

2021/08/24 13:10:45 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #1/10...

2021/08/24 13:10:45 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mysql

2021/08/24 13:10:45 ...ations/migrations.go:419:Migrate() [I] Migration[178]: Add LFS columns to Mirror

2021/08/24 13:10:45 routers/common/db.go:28:InitDBEngine() [W] Table mirror has column id but struct has not related field

2021/08/24 13:10:45 routers/common/db.go:28:InitDBEngine() [W] Table mirror has column repo_id but struct has not related field

2021/08/24 13:10:45 routers/common/db.go:28:InitDBEngine() [W] Table mirror has column interval but struct has not related field

2021/08/24 13:10:45 routers/common/db.go:28:InitDBEngine() [W] Table mirror has column enable_prune but struct has not related field

2021/08/24 13:10:45 routers/common/db.go:28:InitDBEngine() [W] Table mirror has column updated_unix but struct has not related field

2021/08/24 13:10:45 routers/common/db.go:28:InitDBEngine() [W] Table mirror has column next_update_unix but struct has not related field

2021/08/24 13:10:45 ...ations/migrations.go:419:Migrate() [I] Migration[179]: Convert avatar url to text

2021/08/24 13:10:45 ...ations/migrations.go:419:Migrate() [I] Migration[180]: Delete credentials from past migrations

2021/08/24 13:10:45 ...ations/migrations.go:419:Migrate() [I] Migration[181]: Always save primary email on email address table

2021/08/24 13:10:45 routers/common/db.go:28:InitDBEngine() [W] Table email_address Column lower_email db nullable is true, struct nullable is false

2021/08/24 13:10:45 ...ations/migrations.go:419:Migrate() [I] Migration[182]: Add issue resource index table

2021/08/24 13:10:45 routers/common/db.go:33:InitDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: migrate: do migrate: Error 3750: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

2021/08/24 13:10:45 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds

2021/08/24 13:10:48 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #2/10...

2021/08/24 13:10:48 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mysql

2021/08/24 13:10:48 ...ations/migrations.go:419:Migrate() [I] Migration[182]: Add issue resource index table

2021/08/24 13:10:49 routers/common/db.go:33:InitDBEngine() [E] ORM engine initialization attempt #2/10 failed. Error: migrate: do migrate: Error 3750: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

2021/08/24 13:10:49 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds

2021/08/24 13:10:52 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #3/10...

2021/08/24 13:10:52 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mysql

2021/08/24 13:10:52 ...ations/migrations.go:419:Migrate() [I] Migration[182]: Add issue resource index table

2021/08/24 13:10:52 routers/common/db.go:33:InitDBEngine() [E] ORM engine initialization attempt #3/10 failed. Error: migrate: do migrate: Error 3750: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

2021/08/24 13:10:52 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds

2021/08/24 13:10:55 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #4/10...

2021/08/24 13:10:55 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mysql

2021/08/24 13:10:55 ...ations/migrations.go:419:Migrate() [I] Migration[182]: Add issue resource index table

2021/08/24 13:10:55 routers/common/db.go:33:InitDBEngine() [E] ORM engine initialization attempt #4/10 failed. Error: migrate: do migrate: Error 3750: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

2021/08/24 13:10:55 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds

2021/08/24 13:10:58 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #5/10...

2021/08/24 13:10:58 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mysql

2021/08/24 13:10:58 ...ations/migrations.go:419:Migrate() [I] Migration[182]: Add issue resource index table

2021/08/24 13:10:58 routers/common/db.go:33:InitDBEngine() [E] ORM engine initialization attempt #5/10 failed. Error: migrate: do migrate: Error 3750: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

2021/08/24 13:10:58 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds

2021/08/24 13:11:01 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #6/10...

2021/08/24 13:11:01 ...om/urfave/cli/app.go:524:HandleAction() [I] PING DATABASE mysql

2021/08/24 13:11:01 ...ations/migrations.go:419:Migrate() [I] Migration[182]: Add issue resource index table

2021/08/24 13:11:01 routers/common/db.go:33:InitDBEngine() [E] ORM engine initialization attempt #6/10 failed. Error: migrate: do migrate: Error 3750: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting.

2021/08/24 13:11:01 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds
zeripath

zeripath commented on Aug 24, 2021

@zeripath
Contributor

Looks like the problem is related to ResourceIndex in models/migrations/v182.go and models/index.go

2021/08/24 13:10:45 ...ations/migrations.go:419:Migrate() [I] Migration[182]: Add issue resource index table
lunny

lunny commented on Aug 24, 2021

@lunny
Member

Yes. So v1.15, we have a new table issue_index struct name is ResourceIndex which has no primary key. But for MySQL DB cluster, a primary key is necessary? (I'm not familiar with MySQL DB cluster)

So MySQL DB cluster is never the design target but it works before v1.15. Should we add a primary key for ResourceIndex and support MySQL DB cluster officially?

aqos156

aqos156 commented on Aug 24, 2021

@aqos156
Author
cboylan

cboylan commented on Aug 24, 2021

@cboylan
Contributor

I'm not database expert but I don't think this is MySQL DB cluster specific and applies to MySQL and MariaDB generally. It is just that typically MySQL doesn't require you to have a Primary Key and will create one for you when you don't specify one. However, in many circumstances this is problematic so newer MySQL (via sql_require_primary_key) and MariaDB (via innodb_force_primary_key) can force you to create them.

It sounds like DigitalOcean's hosted databases have made this choice for users.

Rather than testing and supporting MySQL DB cluster specifically you may want to set those vars when using MySQL and MariaDB and maintain compatibility that way.

This writeup tries to cover the why and how of this.

aqos156

aqos156 commented on Aug 24, 2021

@aqos156
Author

I'm not database expert but I don't think this is MySQL DB cluster specific and applies to MySQL and MariaDB generally. It is just that typically MySQL doesn't require you to have a Primary Key and will create one for you when you don't specify one. However, in many circumstances this is problematic so newer MySQL (via sql_require_primary_key) and MariaDB (via innodb_force_primary_key) can force you to create them.

It sounds like DigitalOcean's hosted databases have made this choice for users.

Rather than testing and supporting MySQL DB cluster specifically you may want to set those vars when using MySQL and MariaDB and maintain compatibility that way.

This writeup tries to cover the why and how of this.

Setting these variables is sometimes not an option, because these variables are managed by the provider who uses them to manage clustering and another link

zeripath

zeripath commented on Aug 24, 2021

@zeripath
Contributor

The group_id may as well be a primary key - it has an unique index on it.

cboylan

cboylan commented on Aug 24, 2021

@cboylan
Contributor

Setting these variables is sometimes not an option, because these variables are managed by the provider who uses them to manage clustering and another link

Yes, I was suggesting that Gitea may want to set the variables when testing MySQL/MariaDB support rather than figuring out a Galera cluster and testing with that. Primary keys are important to clustered mysql to ensure that rows can be deleted and that you get consistent order of returned data, but flipping these flags on a single database server is probably sufficient for avoiding this incompatibility in the future.

added a commit that references this issue on Aug 24, 2021
8a56a8b
added 2 commits that reference this issue on Aug 25, 2021
697213b
9032be3
added a commit that references this issue on Aug 25, 2021
695e8ae
locked and limited conversation to collaborators on Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/enhancementAn improvement of existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @lunny@cboylan@zeripath@aqos156

      Issue actions

        Primary key required in MySQL DB clusters · Issue #16802 · go-gitea/gitea