Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for conditional operations #372

Open
AlbanBedel opened this issue Apr 28, 2020 · 4 comments
Open

Add support for conditional operations #372

AlbanBedel opened this issue Apr 28, 2020 · 4 comments

Comments

@AlbanBedel
Copy link

I would like to maintain an RRset of A records that point to several dynamic IP, for this I plan to have a script on each device that would take care of updating its own IP in the RRset. However if 2 or more IP changes at the same time the resulting concurrent read-modify-write access might lead to an inconsistent state.

The usual solution to this problem is to use HTTP conditionals to make sure that no update happened between the read and write. For this responses need to have ETag header and the conditional headers such as If-Match or If-None-Match need to be supported.

Mozilla has a overview of this topic: https://developer.mozilla.org/en-US/docs/Web/HTTP/Conditional_requests

@nils-wisiol
Copy link
Contributor

As an alternative way, we were discussing API access on record level, but have not implemented that yet. Maybe it's a good opportunity to look back at that discussion @peterthomassen

Is there a general solution for conditional requests/ETags in Django?

@peterthomassen
Copy link
Member

Yes, there is: https://docs.djangoproject.com/en/3.0/topics/conditional-view-processing/

This topic (conditionals) as well as RR-level access is entangled with RFC2136 prerequisites and #357. It may make sense to think these through together, so leverage more generic data structure etc.

@nils-wisiol
Copy link
Contributor

A way to go forward with this and #357 could be to implement the zone serial as etag, in order to fail concurrent updates.

@AlbanBedel
Copy link
Author

A way to go forward with this and #357 could be to implement the zone serial as etag, in order to fail concurrent updates.

The serial would be perfect for the zone as a whole, for RR-set that wouldn't be ideal but better than nothing.

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

No branches or pull requests

3 participants