fix: replace named locks with Galera-compatible row locks
Test / test (push) Successful in 25m39s
Build and publish image / image (push) Successful in 16m16s

This commit is contained in:
bryanpedini committed 2026-11-20 16:27:15 +01:00
1 parent ee07866d1c
commit 65d16c2fc6
22 files changed
+314 -365

No files matched your search

+4 -4
View File
@@ -129,7 +129,7 @@ func TestZoneAPIFailurePaths(t *testing.T) {
if tc.ran != "" && len(zoneAPITestingSQL(state, tc.ran)) == 0 {
t.Fatalf("%q did not run before the failure: %v", tc.ran, state.Queries())
}
if tc.status == 0 && len(zoneAPITestingSQL(state, "GET_LOCK")) != 0 && state.rollbacks != 1 {
if tc.status == 0 && len(zoneAPITestingSQL(state, "webui_locks")) != 0 && state.rollbacks != 1 {
t.Fatalf("rollbacks = %d, SQL %v", state.rollbacks, state.Queries())
}
})
@@ -219,7 +219,7 @@ func TestZoneAPIUpdateSOAAmbiguous(t *testing.T) {
server, state := f.server()
c := zoneAPITestRequest(server, f.actor, "soa_update", zoneAPITestName, "", tc.etag, strings.Replace(zoneAPITestSOA, `"retry":600`, `"retry":700`, 1))
zoneAPITestStatus(t, t.Context(), c, tc.status)
if len(zoneAPITestingSQL(state, "UPDATE `")) != 0 || !slices.Equal(f.rows, rows) {
if zoneAPIHasDataWrites(state) || !slices.Equal(f.rows, rows) {
t.Fatalf("ambiguous SOA update wrote data: %v", state.Queries())
}
if tc.status == 422 {
@@ -343,7 +343,7 @@ func TestZoneAPIImportInvalidFinalZone(t *testing.T) {
if !errors.As(err, &apiErr) || apiErr.Status != 422 || !strings.Contains(zoneAPITestJSON(t, apiErr.Extra["errors"]), tc.fragment) {
t.Fatalf("error %#v, want %q", err, tc.fragment)
}
if len(zoneAPITestingSQL(state, "INSERT INTO"))+len(zoneAPITestingSQL(state, "UPDATE `"))+len(zoneAPITestingSQL(state, "DELETE FROM")) != 0 {
if zoneAPIHasDataWrites(state) {
t.Fatalf("invalid import wrote data: %v", state.Queries())
}
})
@@ -359,7 +359,7 @@ func TestZoneAPIRepairBlockedByBrokenSOA(t *testing.T) {
_, err := zoneAPITestCall(t.Context(), c)
var apiErr *apiError
if !errors.As(err, &apiErr) || apiErr.Status != 422 || apiErr.Fields["type"] != "repair the SOA before changing other records" ||
len(zoneAPITestingSQL(state, "INSERT INTO")) != 0 {
zoneAPIHasDataWrites(state) {
t.Fatalf("error %#v, SQL %v", err, state.Queries())
}
c = zoneAPITestRequest(server, f.actor, "soa_update", zoneAPITestName, "", recordETag(rows[0]), zoneAPITestSOA)