Commit e3e92f01 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2856] Add a comment about add_reader() in states other than READY

parent 786a742b
...@@ -131,7 +131,15 @@ class SegmentInfo: ...@@ -131,7 +131,15 @@ class SegmentInfo:
that are using the "current" reader version of the segment. It that are using the "current" reader version of the segment. It
must be called by memmgr when it first gets the pre-existing must be called by memmgr when it first gets the pre-existing
readers or when it's notified of a new reader. No state readers or when it's notified of a new reader. No state
transition happens.""" transition happens.
When the SegmentInfo is not in the READY state, if memmgr gets
notified of a new reader (such as b10-auth) subscribing to the
readers group and calls add_reader(), we assume the new reader
is using the new mapped file and not the old one. For making
sure there is no race, memmgr should make SegmentInfo updates in
the main thread itself (which also handles communications) and
only have the builder in a different thread."""
if reader_session_id in self.__readers: if reader_session_id in self.__readers:
raise SegmentInfoError('Reader session ID is already in readers set: ' + raise SegmentInfoError('Reader session ID is already in readers set: ' +
str(reader_session_id)) str(reader_session_id))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment