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

Improved record deletion performance #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Dunedan
Copy link
Contributor

@Dunedan Dunedan commented Mar 25, 2015

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.

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),
Copy link
Owner

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.

Copy link
Contributor Author

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.

@Dunedan
Copy link
Contributor Author

Dunedan commented Mar 28, 2015

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" %
Copy link
Owner

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.

@Dunedan
Copy link
Contributor Author

Dunedan commented Apr 3, 2015

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).

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