Repository navigation
Conversation
DELETE /nameserver/{id} soft-deleted a nameserver that live zones still
listed, which left those zones with an empty NS set. It now answers 409
while any live zone lists it, and so does a PUT that sets deleted.
Zone writes hold the other half of the rule. Create, a write of the
nameserver set, and a restore answer 400 for a deleted or missing
nameserver. A new zone's default set skips the group's usable
nameservers that are deleted. On mysql the zone write takes a share lock
on the nameserver rows and the delete locks its own row, so only one of
them can win. The zone write takes those locks before any plain read,
since MariaDB refuses a locking read of a row changed after the snapshot.
The file stores run both under one serialize key.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On main, mysql, json and toml answered 200 to
DELETE /nameserver/{id}while a live zone listed it.PUT /nameserver/{id}with{"deleted": true}did the same, andGET /zone/{id}/nsthen answered empty.POST /zoneandPUT /zone/{id}accepted deleted or nonexistent nameserver ids, andPUT{"deleted": false}restored zones listing deleted nameservers.DELETEandPUTwith deleted true now answer 409"nameserver N still serves a live zone". Soft-deleted zones do not count. Zone create, writes to a zone's nameserver set, and restore now answer 400"nameserver N is deleted or does not exist". A create that omits nameservers now skips the group's deleted ones inside the store, so a concurrent delete cannot cause a 400.On mysql, zone writes take
LOCK IN SHARE MODEon nameserver rows before any plain read. A nameserver delete locks its rowFOR UPDATE, then checks live zones, so only one wins. Locking first avoidsER_CHECKREADon MariaDB 11 after a post-snapshot row change. On json and toml, both share one serialize key, like permission create.A mysql race test runs zone create and nameserver delete concurrently. One wins. The loser fails with
STORE_INVALIDorSTORE_CONFLICT. Without the share lock it fails every run. The existingnameserversForzone test now asserts the store refuses a deleted nameserver.