-
Notifications
You must be signed in to change notification settings - Fork 41
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
Improved record deletion performance #20
base: master
Are you sure you want to change the base?
Conversation
Up to now when selecting multiple resource records for deletion for each of them a single message has been sent to the DNS server. This commit changes the behavior to put all requested deletions into a single message, which improves performance.
|
||
output = send_dns_update(dns_update, dns_server, key_name) | ||
delete_response = [{"description": "Deleted Records:<br/>%s" % | ||
'<br />'.join(records), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really fond of having output-formatting in the Python itself. Let the templates handle that.
This way also loses the ability to see a record-by-record accounting of failures and successes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I completely agree on the output formatting. It's just been a quick solution working with the current implementation of error handling in binder in general. I believe the error handling will need a complete overhaul anyway to be more precise and flexible. I intend to address that in future with another pull request.
Regarding the loss of the record-by-record accounting I'm not sure if that's worse than before, because all records which will be deleted belong to the same zone. So we know that if the key works for one of them, it works for the others too. And as the deletion of records even returns successfully if they are not existing, we don't loose information in such a case.
I've added some comments to the lines commented. Just in case they don't show up because of the updated diff. |
records.append("%s.%s" % (resource_record, zone_name)) | ||
|
||
output = send_dns_update(dns_update, dns_server, key_name) | ||
delete_response = [{"description": "Deleted Records:<br/>%s" % |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refuse to put any sort of formatting of the data in the Python itself. Leave the output formatting for the templates.
I understand your concerns regarding the output formatting in code. As I don't have a good solution for that right now, let's just keep the pull request as it is (or close it if you want). |
Up to now when selecting multiple resource records for deletion for each of
them a single message has been sent to the DNS server. This commit changes the
behavior to put all requested deletions into a single message, which improves
performance.