Skip to content

Fix/ipblock unique version v2 - #324

Open
miesi wants to merge 2 commits into
IONOS-Core:masterfrom
miesi:fix/ipblock-unique-version-v2
Open

miesi wants to merge 2 commits into
IONOS-Core:masterfrom
miesi:fix/ipblock-unique-version-v2

Conversation

@miesi

@miesi miesi commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

No description provided.

miesi-ionos and others added 2 commits October 13, 2026 12:20
…ate-1.t

'list containers' grew a 'layer3domain: <name>' header; the two
per-CIDR invocations in this file were updated for it but the
'list containers layer3domain default' one was missed. The ::/0 bug
masked it because the test never reached that line.
0.0.0.0/0 and ::/0 both have address 0 and prefix 0, so the key
(address, prefix, layer3domain_id) could not hold both in one
layer3domain: creating the second one died with a raw
MySQLdb.IntegrityError leaking the INSERT statement to the user.
`version` is part of a block's identity and belongs in the key.

It is appended rather than inserted so the existing
(address, prefix, layer3domain_id) index prefix stays usable, and the
index keeps its name -- Ipblock._set_parent() references it via
USE INDEX (address).

The migration only relaxes the constraint, so no existing row can
violate it. ALGORITHM=INPLACE, LOCK=NONE makes the server refuse
instead of falling back to a copying, locking ALTER. Running it on a
database whose index was already widened by hand (ITOUDP-7795, uat)
just rebuilds the same index.

Originally written as 12 -> 13 on fix/ipblock-unique-version; master
has used 13 for the pseudo user column since, hence 13 -> 14.

ITOUDP-7795

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@miesi

miesi commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

builds on top of #319. merge #319 first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants