BIND 10 #3019: update memmgr to handle restart cases correctly
BIND 10 Development
do-not-reply at isc.org
Thu Jun 27 07:37:25 UTC 2013
#3019: update memmgr to handle restart cases correctly
-------------------------------------+-------------------------------------
Reporter: jinmei | Owner:
Type: task | Status: new
Priority: medium | Milestone: New
Component: shmem | Tasks
manager | Resolution:
Keywords: | CVSS Scoring:
Sensitive: 0 | Defect Severity: N/A
Sub-Project: DNS | Feature Depending on Ticket:
Estimated Difficulty: 0 | Add Hours to Ticket: 0
Total Hours: 0 | Internal?: 0
-------------------------------------+-------------------------------------
Description changed by jinmei:
Old description:
> This task implements the proposed idea at the memmgr described in
> https://lists.isc.org/pipermail/bind10-dev/2013-June/004691.html
> It depends on #3018 (with a mock we may be able to work on this task
> in parallel with #3018).
>
> Specifically, we update the constructor of
> `isc.memmgr.datasrc_info.MappedSegmentInfo`. Instead of always
> assuming `__reader_ver` is None and `__writer_ver` is 0, it should
> check if the ".0" and ".1" files exist. If the file exists, it tries
> to reset the segment in the read only mode and sees if it's dirty
> (it'll need to call get_status() again).
>
> - If ".0" is (existent and) non-dirty while ".1" isn't, `__reader_ver`
> should be ".0" and `__writer_ver` should be ".1"
> - If ".1" is (existent and) non-dirty while ".0" isn't, `__reader_ver`
> should be ".1" and `__writer_ver` should be ".0"
> - If both ".0" and ".1" are (existent and) non-dirty, `__reader_ver`
> should be the newer one (in terms of modification time) and
> `__writer_ver` should be the other.
> - If neither ".0" nor ".1" is non-dirty, `__reader_ver` should be None
> and `__writer_ver` should be ".1" (just like the current default).
>
> I believe we don't have to update other parts of memmgr, but please
> check that.
New description:
This task implements the proposed idea at the memmgr described in
https://lists.isc.org/pipermail/bind10-dev/2013-June/004691.html
It depends on #3018 (with a mock we may be able to work on this task
in parallel with #3018).
Specifically, we update the constructor of
`isc.memmgr.datasrc_info.MappedSegmentInfo`. Instead of always
assuming `__reader_ver` is None and `__writer_ver` is 0, it should
check if the ".0" and ".1" files exist. If the file exists, it tries
to reset the segment in the read only mode and sees if it's dirty
(it'll need to call get_status() again).
- If ".0" is (existent and) non-dirty while ".1" isn't, `__reader_ver`
should be ".0" and `__writer_ver` should be ".1"
- If ".1" is (existent and) non-dirty while ".0" isn't, `__reader_ver`
should be ".1" and `__writer_ver` should be ".0"
- If both ".0" and ".1" are (existent and) non-dirty, `__reader_ver`
should be the newer one (in terms of modification time) and
`__writer_ver` should be the other.
- If neither ".0" nor ".1" is non-dirty, `__reader_ver` should be None
and `__writer_ver` should be ".1" (just like the current default).
Also, if the initial `__reader_ver` is not None, set the state to
"UPDATING".
We'll also need to update the `Memmgr` class so that if the reader
version of a segment is initially available it starts as if "UPDATING"
phase has just completed (to be synchronized with existing readers)
before telling the builder thread to start loading. One way of doing
this is (there may be a better way, consider it) would be:
- add existing readers in `Memmgr.__init_segment()` instead of
(as #2858 said) `Memmgr._setup_modeul()`.
- In `__init_segment()`, if the reader version is already available,
initiate the initial transition from UPDATING to SYNCHRONIZING,
and send 'segment_info_update' command to the pre-existing readers.
{{{#!python
def __init_segments(self, datasrc_info):
for key, sgmt_info in datasrc_info.segment_info_map.items():
# Assume we have __get_all_readers(), which returns all
# pre-existing readers
for reader in self.__get_all_readers('MemoryReaders'):
sgmt_info.add_reader(reader)
rrclass, dsrc_name = key
clist = self._datasrc_clients_mgr.get_client_list(rrclass)
cmd = ('load', None, dsrc_name, rrclass, clist, sgmt_info)
sgmt_info.add_event(cmd)
reader_param = sgmt_info.get_reset_param(READER)
if reader_param is not None:
init_cmd = sgmt_info.complete_update()
else:
init_cmd = sgmt_info.start_update()
#assert cmd == ret_cmd and sgmt_info.state == UPDATING
if init_cmd is not None:
with self.__cv_commands:
self.__command_queue.append(cmd)
self.__cv_command.notify()
elif len(sgmt_info.old_readers) > 0:
# send 'segment_info_update' command to old readers
}}}
--
--
Ticket URL: <http://bind10.isc.org/ticket/3019#comment:1>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list