On Tue, May 08, 2012 at 08:07:11PM -0700, Aniruddha Laud wrote:
> When the RegionManager subscribes to topics from a remote hub, it gets
> merges the remote component part of the received message with that of the
> last persisted local message. The merge policy takes the maximum of the two
> values for any region X in these two messages. Why exactly is this being
> done? How is the remote component section from one region useful for hubs
> in another region?
My understanding of this code is that it is trying to ensure that the
remote components for a topic are monotonically increasing in the view
of a single region.

Take the example of 3 regions, A,B&C, with topic t.

A publishes message 1, which B and C receives with remote components
[A:1,B:null,C:null].

Now A publishs message 2, so which arrives quickly at B but with a
delay at C.

The last pushedSeqId for the topic is now
at A: [A:2,B:null,C:null]
at B: [A:2,B:null,C:null]
at C: [A:1,B:null,C:null]

C now publishes to topic t. The message has remote components of
[A:1,B:null,C:1]

When this arrives at B, if B does not do the merging, the client will
see that the remote component for A is not increasing monotonically. 

Utkarsh can probably give you more detail on this.

Regards
Ivan

Reply via email to