Skip to content

Gitea shows outdated commit status with distributed DB backend (eg. TiDB) #30074

Closed
@stevapple

Description

@stevapple

Description

Gitea doesn’t always show the latest commit status (i.e. being outdated) if you use some distributed database as backend. An auto_increment primary key, though being expected to bump at a step of 1 at every INSERT, may be designed to bump independently on each nodes.

We should update commit_status.go to use the (max(`index`), repo_id, sha) triple to determine the latest commit status, instead of relying on max(id).

Gitea Version

1.21.9

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

I’m running Gitea on a Kubernetes cluster, which also hosts Woodpecker CI v2.3.0 and TiDB v7.5.1. Gitea uses TiDB (through mysql) as backend and Woodpecker uses Gitea as forge.

The problem was originally identified as “randomly dropping commit status on either Woodpecker, Gitea and TiDB side”, but after digging into the database it turns out that all commit statuses were there.

Database

MySQL/MariaDB

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions