Options for Region Distribution

You can use distribution with and without acknowledgment or global locking for your region distribution.

Each distributed region must have the same scope setting throughout the distributed system.

Distributed scope is provided at three levels:
  • distributed-no-ack. Distribution operations return without waiting for a response from other caches. This provides the best performance, but is also most prone to race conditions. A temporary disruption of the network transport layer, for example, could cause failure of a distribution to a cache on a remote machine.
  • distributed-ack. Distribution waits for acknowledgment from other caches before continuing. This behavior can be modified with the early-ack region attribute. This is slower than distributed-no-ack, but covers simple communication problems such as temporary network disruptions. Race conditions are still possible, however, as there is no guarantee that updates sent from multiple caches arrive in the proper time order. Distribution operations may arrive out of order due to network latency and other differences between caches. For example, some caches may reside on the same machine while others communicate over large networks. Because there is no locking, with either distributed-ack or distributed-no-ack scope it is possible for two members to replace an entry value simultaneously.

    In systems where there are many distributed-no-ack operations, it is possible for distributed-ack operations to take a long time to complete. The distributed system has a configurable time to wait for acknowledgment to any distributed-ack message before sending alerts to the logs about a possible problem with the unresponsive member. No matter how long the wait, the sender keeps waiting in order to honor the distributed-ack region setting. The gemfire.properties attribute governing this is ack-wait-threshold.

  • global. Entries and regions are automatically locked across the distributed system during distribution operations. All load, create, put, invalidate, and destroy operations on the region and its entries are performed with a distributed lock. This is the only scope that absolutely guarantees consistency across the distributed system. It is also the slowest. In addition to the implicit locking performed by distribution operations, regions with global scope and their contents can be explicitly locked through the application APIs. This allows applications to perform atomic, multi-step operations on regions and region entries.