Failure Scenarios with Non-Atomic Operations

Because there is no atomicity for multiple operations that occur outside of a transaction, different GemFire XD member failure scenarios can lead to data inconsistencies that are hard to diagnose. Some potential failure scenarios and their consequences are described in this section.

Best Practices for Avoiding Data Inconsistencies

Each of the above failure scenarios can cause data inconsistency problems that may be hard to detect, and that cannot be resolved by simply retrying operations from the client. Always keep in mind the potential pitfalls associated with using non-atomic operations, and use transactions where necessary to preserve the integrity of your data. To ensure data consistency at all times, always perform the following operations from within a transaction with REPEATABLE_READ isolation:
  • Insert, update, or delete operations on rows in tables with unique or foreign key constraints.
  • Operations that invoke triggers.
  • Statements that use accumulative expressions (such setting a column "x" to the value "x+1").
  • Bulk DML operations.

In addition, always configure partitioned tables with at least one redundant copy.