• Patch
  • Status: Resolved
  • 2 Major
  • Resolution: Duplicate
  • ehcache-jgroupsreplication
  • drb
  • Reporter: cvidal
  • September 28, 2012
  • 0
  • Watchers: 1
  • September 28, 2012
  • September 28, 2012

Attachments

Description

As mentionned in EHC-874, “Synchronous” JGroups replication is not really synchronous. I stumbled upon the same problem as Manuel Dominguez Sarmiento but I fixed the problem using an simpler approach.

As stated in the JGroups documentation, in order for messages to be sent synchronously, you need two things:

  • The RSVP protocol declared in the stack above the GMS protocol and under the UNICAST one.
  • You also need to set the RSVP flag on the message to send synchrously

The first condition is only met by proper configuration of the JGroups stack in the JGroups XML configuration file. Note that you need to give your own properly configured file because the default JGroups udp.xml file puts the RSVP protocol too low in the stack to receive view change events from the GMS protocol required to properly wait for all cluster members acknowledges.

A udp.xml based JGroups configuration file which fixes the RSVP protocol position is attached for convenience.

The second one needs to be carried by the code and the jgroups-replication module doesn’t set that flag.

This simple patch just modifies the {{JGroupsCachePeer}} so that it sets the RSVP flag on the message when the cache level {{JGroupsCacheReplicatorFactory}} {{replicateAsynchronously}} property is set to {{false}}.

Comments

Cedric Vidal 2012-09-28

Sorry, I realized I posted this patch to the wrong project, I recreated is here EHCJGRP-9