Repository navigation
NIFI-16582 Support Redis Enterprise and Cloud atomic map cache operations - #11919
Conversation
…ions Replace transaction-based conditional operations with single-key Lua scripts, support Cluster connections, and document managed database endpoint configuration. Add authenticated standalone and Cluster API regression coverage.
883a371 to
b0e73a9
Compare
|
@pvillard31 I completed live acceptance testing at b0e73a9 and updated the PR description with the matrix, connection-mode guidance, and remaining checks. Standalone mode connects NiFi to one Enterprise Software or Redis Cloud database proxy endpoint. Redis routes requests across its backend shards and nodes, so this mode supports sharded, multi-node deployments. Cluster mode / OSS Cluster API makes the client discover the slot topology and connect to the relevant node proxies; it can reduce internal forwarding but is not required for sharded proxy access. Official references: proxy policies, Cluster API architecture, and Cloud clustering. Software passed 1 node / 1 shard, 1 node / 3 shards, 3 nodes / 1 replicated primary, and 3 nodes / 3 primaries. Newly provisioned Cloud Pro databases with 1 and 2 primary shards also passed, both with TLS and multi-zone replication. These tests used Standalone mode. Software runs verified effective 4x QPF; Cloud readbacks confirmed 4x QPF. 115 selected integration executions passed, including restricted ACLs without WATCH/MULTI/EXEC, mTLS, missing-EVAL refusals without changing data, planned failover, abrupt primary-node loss, and continuous atomic operations during a one-to-three-shard expansion (7,516 cycles read back, no mutation retries). The external-endpoint harnesses are local artifacts and are not yet committed; the description distinguishes those runs from the committed fixtures. The MOVED/ASK gap remains on the separate Cluster API test path. These proxy tests do not establish multi-node client redirects or global Active-Active compare-and-set. Temporary test resources were deleted. |
|
@alberttwong - I don't see any change on the PR. Expected? a missing push? |
|
@pvillard31 Sorry, the source changes hadn't been pushed. They're in now: the docs moved to |
Convert the RedisDistributedMapCacheClientService additional details to Markdown so they appear in the NiFi 2.x UI, add an upgrade note for the new EVAL permission requirement, document that the single-node Cluster test does not exercise MOVED or ASK redirects, and describe expected TTL behavior in the replacement test comment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25843c0 to
51122da
Compare
|
@pvillard31 All four review threads are addressed in 51122da, and CI is green. Could you take another look when you have a chance? |
Summary
NIFI-16582
RedisDistributedMapCacheClientService supports Redis Enterprise Software and Redis Cloud database proxy endpoints, including single-shard and sharded databases on one or multiple nodes. Configure the Redis connection pool in Standalone mode for these proxy endpoints; Redis handles backend shard and node routing. Standalone describes the client connection mode, not the server's shard or node count.
This change replaces WATCH/MULTI/EXEC conditional cache operations with single-key Lua scripts for get-and-insert and compare-and-set, and SET NX with expiration for conditional inserts. It preserves serialization, raw-value revisions, and TTL behavior, and removes the validation restriction against Cluster connection pools. SimpleRedisDistributedMapCacheClientService is unchanged.
Upgrade ACL requirement: existing Standalone and Sentinel users must grant EVAL, GET, SET, and access to the serialized cache keys before upgrading. WATCH/MULTI/EXEC permissions alone are insufficient for getAndPutIfAbsent and replace. Other cache methods retain their command requirements.
Connection mode and Redis topology
Standalone mode — routing by the database proxy. NiFi connects to one Redis Enterprise Software or Redis Cloud database endpoint. The Redis proxy routes each request to the appropriate backend shard, including when shards are distributed across multiple nodes. Standalone mode does not mean an unsharded or single-node server. This is the connection path covered by the live Enterprise/Cloud acceptance matrix below.
Cluster mode — topology-aware routing by the client. With Redis's optional OSS Cluster API enabled, NiFi's client discovers the hash-slot topology, connects to proxies on the relevant nodes, and handles client redirects when necessary. This can reduce internal forwarding and improve latency or throughput. It requires a cluster-aware client and network reachability to the advertised endpoints. It is an optional routing optimization, not a requirement for a sharded Enterprise/Cloud deployment.
Both modes still use Redis Enterprise proxies. The difference is whether the client discovers and selects node endpoints or delegates shard routing to a single database endpoint. Redis Software supports the OSS Cluster API when its documented prerequisites are met; on Redis Cloud it is available for Pro databases.
Official Redis documentation:
Verification
Live Enterprise Software and Cloud acceptance — November 18, 2026
Validated production source at b0e73a9, using JDK 21 and local external-endpoint test harnesses. All entries below used NiFi Standalone mode, password authentication, and TLS; Cluster API was disabled on these fixtures.
These six runs passed 82 integration executions, with zero failures, errors, or skips. Replica shards are excluded from the primary count. Cloud multi-zone replication was confirmed through the Cloud API; no independent physical-host census is claimed.
Software version: 8.2.6-52, database engine 8.8.0. Cloud Pro: Redis version 8.6 reported by the control plane. Software tests verified effective 4x QPF before testing: active scaling factor 4, six Search workers, mnp routing, and 32 connections. Cloud API readbacks confirmed 4x QPF.
The original 12-case atomic cache contract covered binary/empty values, absent/matching/stale revisions, positive/zero TTL, expiration on success/conflict, and competing inserts/replacements with exactly one winner. An additional probe exercised 96 distinct hash tags. The later 14-case runs also covered bulk writes, existence checks, reads, deletes, and repeated deletes. On three-node Software, per-primary key counts matched slot ownership with 30, 36, and 30 keys, a primary on each node.
Additional Software scenarios passed:
Total: 115 selected integration executions passed, plus targeted topology unit tests and two transport-negative checks. The failover tests paused mutations between the before/after phases; they do not establish lossless recovery of in-flight writes or exactly-once retries. The resharding workload did run during the topology change.
The external-endpoint harnesses are local acceptance artifacts and are not yet committed to this PR. Production source remained unchanged during these runs. The NiFi services, Redis client, scripts, TLS connections, and servers were real; a test SSLContextProvider supplied a real Java SSLContext. Maven reactor verify passed; Checkstyle and PMD were skipped for these local harness runs. Both temporary Cloud databases, their Pro subscription, and the local Software fixture were deleted after validation. Credentials, endpoints, infrastructure identifiers, and raw operational artifacts remain private.
Earlier committed-fixture validation
Remaining checks and review follow-ups
Multi-node OSS Cluster API redirects remain unverified by the new proxy matrix. This does not limit the verified Enterprise/Cloud proxy topology support above. Single-key atomic operations do not provide globally serialized compare-and-set across independent writable Active-Active regions. Bulk putAll retains its MSET behavior without a cross-slot transaction guarantee.
Licensing
No dependencies added or upgraded; no dependency LICENSE/NOTICE changes.