Browse Source

When zone transfer finishing, it will send the same command to zone manager and xfrout module, so the zone manager can reset the timer for the next refresh, and xfrout module will notify the zones' slaves.

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac289@2619 e5f2f494-b856-4b98-b285-d166d9295462
Likun Zhang 14 years ago
parent
commit
e0e5e396c1
2 changed files with 8 additions and 5 deletions
  1. 7 4
      src/bin/xfrin/xfrin.py.in
  2. 1 1
      src/lib/python/isc/notify/notify_out.py

+ 7 - 4
src/bin/xfrin/xfrin.py.in

@@ -51,6 +51,7 @@ SPECFILE_LOCATION = SPECFILE_PATH + "/xfrin.spec"
 AUTH_SPECFILE_LOCATION = AUTH_SPECFILE_PATH + "/auth.spec"
 
 XFROUT_MODULE_NAME = 'Xfrout'
+ZONE_MANAGER_MODULE_NAME = 'Zonemgr'
 __version__ = 'BIND10'
 # define xfrin rcode
 XFRIN_OK = 0
@@ -194,7 +195,7 @@ class XfrinConnection(asyncore.dispatcher):
                                             self._handle_xfrin_response)
 
                 self.log_msg(logstr + 'succeeded')
-                self._server.send_notify_command(self._zone_name)
+                self._server.publish_xfr_finish_news(self._zone_name)
                 ret = XFRIN_OK
 
         except XfrinException as e:
@@ -449,11 +450,13 @@ a separate method for the convenience of unit tests.
 
         return answer
 
-    def send_notify_command(self, zone_name):
-        '''Send Notify command to xfrout module.'''
+    def publish_xfr_finish_news(self, zone_name):
+        '''Send command to xfrout/zone manager module, that 
+        xfr has finished for one zone, new zone data is ready.'''
         param = {'zone_name': zone_name}
-        msg = create_command(notify_out.ZONE_NOTIFY_CMD, param)
+        msg = create_command(notify_out.ZONE_NEW_DATA_READY_CMD, param)
         self._send_cc_session.group_sendmsg(msg, XFROUT_MODULE_NAME)
+        self._send_cc_session.group_sendmsg(msg, ZONE_MANAGER_MODULE_NAME)
 
     def _parse_cmd_params(self, args):
         zone_name = args.get('zone_name')

+ 1 - 1
src/lib/python/isc/notify/notify_out.py

@@ -11,7 +11,7 @@ except ImportError as e:
     # C++ loadable module may not be installed; 
     sys.stderr.write('[b10-xfrout] failed to import DNS or XFR module: %s\n' % str(e)) 
 
-ZONE_NOTIFY_CMD = 'zone_new_data_ready'
+ZONE_NEW_DATA_READY_CMD = 'zone_new_data_ready'
 _MAX_NOTIFY_NUM = 30
 _MAX_NOTIFY_TRY_NUM = 5
 _EVENT_NONE = 0