In case Redis is configured with a replica shard, we should allow to verify that the data (XADD commands in the Sink and also history and offset) has been written to the replica. For that, these properties should be introduced (with the standard prefix):
wait_enabled : Checks if the data has been written to the replica shard
wait_timeout: Timeout in milliseconds when checking write to the replica shard
default: 1000 (minimum 1, as we don’t want to support 0 - blocking, as in case of an issue with the replica, everything will be stuck)
retry_on_replica_failure: Ensures that the data has been written to the replica shard and keeps retrying if not
If wait_enabled is true (should be false, by default), execute this wait command with 1 replica and the wait timeout
If the result is not 1 (meaning, the replica shard has not been updated):
if retry_on_replica_failure is false - just log an error and continue
if true -sleep for X milliseconds (also should be a parameter) and try to write the same data again (do not proceed to the next batch).
we use 1 as the number of replicas as in Redis Enterprise there could be only 1 replica shard.