Deleting Record With BIND 9 Driver Fails

Bug #1261894 reported by Ron Rickard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Designate
Fix Released
Undecided
Ron Rickard
Havana
New
Undecided
Ron Rickard
Icehouse
Triaged
Undecided
Ron Rickard

Bug Description

If you delete a record using the Designate BIND 9 driver, the record still exists in DNS.

To see this problem, create a record:

designate record-create <domain-id> --type A --name www.example.com. --data 1.2.3.4

Ensure the record exists in DNS:

host www.example.com

Delete the record:

designate record-delete <domain-id> <record-id>

The record is removed from the Designate database:

record-list <domain-id>

But, the record still exists in DNS:

host www.example.com

Subsequent activity with designate (adding a new record for example) causes the record to be deleted.

Tags: backend
Ron Rickard (rjrjr)
description: updated
tags: added: backend
Revision history for this message
Ron Rickard (rjrjr) wrote :

In designate/storage/api.py, we have:

@contextlib.contextmanager
    def delete_record(self, context, record_id):
        """
Delete a record

:param context: RPC Context
:param record_id: Record ID to delete
"""
        yield self.storage.get_record(context, record_id)
        self.storage.delete_record(context, record_id)

If we change this to:

@contextlib.contextmanager
    def delete_record(self, context, record_id):
        """
Delete a record

:param context: RPC Context
:param record_id: Record ID to delete
"""
        record = self.storage.get_record(context, record_id)
        self.storage.delete_record(context, record_id)
        yield record

On the surface, it fixes the BIND 9 driver and we can delete records successfully. I'm guessing this is not desired however. Am I correct about this?

The real issue here is how the backend BIND 9 driver works. The code as written gets the record, passes the record to the backend, and the backend should do something with that record. With the BIND 9 driver, it doesn't do anything with the record, but constructs a new zone file and reloads it. Then the record is delete from the central storage. Unfortunately, the record was present during the zone file creation, hence the record is not being deleted.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to designate (master)

Fix proposed to branch: master
Review: https://review.openstack.org/63014

Changed in designate:
assignee: nobody → Ron Rickard (rjrjr)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/96204

Changed in designate:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to designate (master)

Reviewed: https://review.openstack.org/96204
Committed: https://git.openstack.org/cgit/stackforge/designate/commit/?id=a4cb85e11d774b3b49d138baa6d47e4cb36a4789
Submitter: Jenkins
Branch: master

commit a4cb85e11d774b3b49d138baa6d47e4cb36a4789
Author: rjrjr <email address hidden>
Date: Fri May 30 19:52:40 2014 -0700

    Bug #1261894: Deleting Record With BIND 9 Driver Fails

    Fix the delete_record/delete_recordset method so it deletes the
    record/recordset in the central storage before the BIND 9 backend
    gets the request to delete the record/recordset.

    Changed the other delete_<object> methods (quota, server, etc.) with the
    same fix. Finally, all the delete_<object> methods in the storage have
    been simplified and make less SQL calls by returning the object from the
    delete_<object> method instead of making another get_<object> call.

    Change-Id: I10ceb1f5c2550724f1a752a79319a4bbf366876b
    Closes-bug: #1261894

Changed in designate:
status: In Progress → Fix Committed
Changed in designate:
milestone: none → juno-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in designate:
milestone: juno-2 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.