Add KeyValue and EvaluationContext args to compare #156
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem Statement:
The current
compare
command in Redis RIOT does not support specifying key/value processing arguments, such as--key-proc
, when performing an on-demand comparison. This limits the ability to replicate the same key transformations that are automatically applied during the replication process (e.g., prefixing keys with--key-proc "yourprefix:#{key}"
argument).While the automatic comparison after each
replicate
scan cycle correctly respects these transformations, the on-demandcompare
command lacks the capability to apply them, which prevents users from comparing data in the same way as they would during replication.Proposed Solution:
This PR introduces support for key/value processing arguments (e.g.,
--key-proc
) to the on-demand compare command using the sameKeyValueProcessorArgs
as inreplicate
command. This ensures that users can apply the same transformations during ad-hoc comparisons as they can during the replication process, maintaining consistent behavior between automatic and on-demand comparisons.Benefits:
Use Case:
For example, when replicating keys and prefixing them (e.g., with
--key-proc "yourprefix:#{key}"
argument), users cannot currently perform an accurate on-demand comparison because the transformations are not applied in the compare command. This PR resolves that limitation by enabling key/value processing arguments in the on-demand comparison.