Skip to content

Adapt to MariaDB innodb_snapshot_isolation=ON starting from release 11.8 #721

Description

@ValeriiVozniuk

Hi,

MariaDB 11.8+ have innodb_snapshot_isolation enabled by default, which causes issues with k3s COMPACT process
Log example:

Jul 27 06:57:53 frnode-01.domain.local k3s[834088]: time="2026-07-27T06:57:53Z" level=info msg="COMPACT compactRev=1812348155 targetCompactRev=1812349155 currentRev=1876205584"
Jul 27 06:57:53 frnode-01.domain.local k3s[834088]: time="2026-07-27T06:57:53Z" level=info msg="COMPACT deleted 1000 rows from 1000 revisions in 527.728527ms - compacted to 1812349155/1876205584"
Jul 27 06:57:53 frnode-01.domain.local k3s[834088]: time="2026-07-27T06:57:53Z" level=info msg="COMPACT compactRev=1812349155 targetCompactRev=1812350155 currentRev=1876205604"
Jul 27 06:57:53 frnode-01.domain.local k3s[834088]: time="2026-07-27T06:57:53Z" level=info msg="COMPACT deleted 991 rows from 1000 revisions in 248.617505ms - compacted to 1812350155/1876205604"
Jul 27 06:57:53 frnode-01.domain.local k3s[834088]: time="2026-07-27T06:57:53Z" level=info msg="COMPACT compacted from 1812348155 to 1812350155 in 2 transactions over 803ms"
Jul 27 06:57:53 frnode-01.domain.local k3s[834088]: time="2026-07-27T06:57:53Z" level=error msg="Compact failed: failed to get current revision: Error 1020 (HY000): Record has changed since last read in table 'kine'; try restarting transaction"

MariaDB now expects that application seeing Error 1020 would immediately retry the operation, while usual response to error would be to abort the operation. More details on the change, and related issues could be found here - https://www.percona.com/blog/mariadbs-snapshot-isolation-a-fix-that-breaks-more-than-it-fixes/

For now I've fixed the issue by disabling innodb_snapshot_isolation, but it would be nice to have kine adapted to that change, and have retry on Error 1020 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions