diff options
author | YR Chen <stevapple@icloud.com> | 2024-03-28 16:01:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-28 16:01:15 +0800 |
commit | 7443a10fc3d722d3326a0cb7b15b208f907c72d7 (patch) | |
tree | 6a099e6fbd8a114fb4b260e96b832bae89c28247 /web_src | |
parent | 0d5abe3454c73f11d90d2809af0949a0e0636c22 (diff) | |
download | gitea-7443a10fc3d722d3326a0cb7b15b208f907c72d7.tar.gz gitea-7443a10fc3d722d3326a0cb7b15b208f907c72d7.zip |
Move from `max( id )` to `max( index )` for latest commit statuses (#30076)
This PR replaces the use of `max( id )`, and instead using ``max(
`index` )`` for determining the latest commit status. Building business
logic over an `auto_increment` primary key like `id` is risky and
there’re already plenty of discussions on the Internet.
There‘s no guarantee for `auto_increment` values to be monotonic,
especially upon failures or with a cluster. In the specific case, we met
the problem of commit statuses being outdated when using TiDB as the
database. As [being
documented](https://docs.pingcap.com/tidb/stable/auto-increment),
`auto_increment` values assigned to an `insert` statement will only be
monotonic on a per server (node) basis.
Closes #30074.
Diffstat (limited to 'web_src')
0 files changed, 0 insertions, 0 deletions