Amar Gajbhiye
Amar Gajbhiye

Reputation: 484

Apache IgniteCache Entry processor execution on Primary and replicas

Is there any possible way by which one can configure execution of CacheEntryProcessor as follows, EP should be executed on

  1. Only primary

  2. On primary as well as Replicas

I am aware that if I have ATOMIC cache, EP will only be executed only on the primary and only entry is sent to replicas, not EP.

But what I want is following

With TRANSACTIONAL cache, EP will be sent to primary as well as replicas, but for reading I want EP to execute only on Primary.

It is possible to achieve this on Apache IgniteCache.

Upvotes: 2

Views: 478

Answers (1)

Nikolay Tikhonov
Nikolay Tikhonov

Reputation: 421

Apache Ignite doesn't send a delta to backups (replica) nodes in ATOMIC mode. If EntryProcessor modifies entry then whole entry will be sent to backup nodes, not delta. When entry processor only read data ( doesn't invoke MutableEntry#setValue method) then EP won't be sent to backup nodes. This works by default for ATOMIC and TX cache modes.

Any way, user's code should not depend from this behavior because it's details of implementation. It's the best practices.

Upvotes: 3

Related Questions