KB-5230044

Keep HA database offsets with the physical node

Verify MariaDB’s effective offset and explain why it must not follow the primary or secondary role.

15 views

Separate ID allocation from role

RadiusStack’s Compose configuration sets MariaDB’s auto-increment increment to 2 and supplies the offset from HA_DB_OFFSET. Assign offset 1 to one node, offset 2 to the other, and keep that identity after promotion or demotion. The RADIUS history scanner looks at ID parity as well as a time/ID cursor. Changing offset can therefore affect which records a node considers its own. It does not renumber historical IDs, resolve duplicates on different databases, or prove that two prepopulated stores can be joined.[3][9][13]

Verify runtime values without exposing credentials

Use the correct Compose invocation on each host and run this read-only check. The password is drawn from the MariaDB container’s environment; do not replace it with a literal in a command line. Record the two returned values and the role shown in Global → Settings → High Availability Status on the same host. Keep the before-and-after values in the rehearsal record.[9][11]

docker compose exec -T mariadb sh -c 'MYSQL_PWD="$MYSQL_ROOT_PASSWORD" exec mariadb -uroot -N -e "SELECT @@GLOBAL.auto_increment_increment, @@GLOBAL.auto_increment_offset"'

For example, A at 203.0.113.41 should report 2 and 1 while B at 203.0.113.42 should report 2 and 2. After promoting B in a rehearsed failover, the offset report must still be 2 and 2 on B. Ordinary new automatically generated local records follow their node’s allocation; replicated rows can keep the originating IDs, so do not infer a node’s active offset by looking at every row in its copy.[9][13][14]

Handle an offset mismatch as a data incident

If both nodes return the same offset, fence the suspect writer and capture each node’s data, runtime roles, time window and effective Compose selection. Do not switch an offset and assume previously generated IDs are corrected. Compare records created during the suspect period by tenant and stable business identifiers on copies. An empty queue does not remove historical conflict risk. Fix startup configuration only through the reviewed plan, then prove both effective values and test new events before making the node eligible for traffic. Keep the node excluded if you cannot account for ambiguous or missing records.

References