Apache Ignite Replicated Cache race conditions? -


i'm quite new apache ignite please gentle. question simple. if have replicated cache using apache ignite. write cache key 123. cluster has 10 nodes.

first question is:

does replicated cache mean before "put" call comes key 123 must written 10 nodes? or call come , replication done behind scenes?

second question is: lets key 123 written on node 1. it's being replicated other nodes. few microseconds later node 2 tries write key 123 different value. have race condition? or ignite somehow handles situation in such way node 2's attempt write key 123 won't happen until node 1's "put" has replicated across nodes?

for context, i'm trying build de-duplication system across cluster of api machines. hoping able create hash of api request (with values make request unique) , write ignite cache. api request proceed if cache not contain unique hash (possibly created different api instance). of course cache have eviction policy evict these cache keys after few seconds because won't needed anymore.

replicated cache same partitioned infinite number of backups , optimizations. has primary partitions distributed across nodes according affinity function.

now when perform update, request comes primary node, , primary node, in it's turn, updates backups. property cacheconfiguration.setwritesynchronizationmode() responsible way in entries updated. default it's primary_sync, means thread calls put() wait primary partition update, , backups updated asynchronously. if set full_sync, thread released when backups updated.

answering second question, there not race condition, because requests come primary node.

additionally clarification, if backup node wasn't updated yet, get() request go primary node, in primary_sync mode you'll never null if primary partition has value.


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -