Conversation
fix indent fix some format add test units for COPY command
| assert {[r get mynewkey] eq "foobar"} | ||
| r flushdb | ||
| } | ||
|
|
There was a problem hiding this comment.
It would be nice to add a test for all the different types. You can use debug digest to validate that the key/values are the same.
There was a problem hiding this comment.
Looks like the stream digest doesn't include consumer group information, probably worth expanding on that.
There was a problem hiding this comment.
i'm not certain we want digest to include it.
there are commands that modify these which consider them metadata.
IIRC they do perform dirty++ and are propagated to replicas and RDB/AOF, and only avoid doing signalModifyKey (invalidating WATCH), so maybe that means that they should indeed be in the digest.
@guybe7 anything to add?
There was a problem hiding this comment.
since CGs go in the AOF and RDB i think they should be included in the digest
|
just mentioning that i didn't go over the code yet (just took a quick look at the comments @madolson gave). p.s. maybe in a followup PR, you can add module API callback so that modules can provide cloning functionality. but let's put that aside for now. |
madolson
left a comment
There was a problem hiding this comment.
Most of it reviewed now! Generally looks good.
| assert {[r get mynewkey] eq "foobar"} | ||
| r flushdb | ||
| } | ||
|
|
There was a problem hiding this comment.
Looks like the stream digest doesn't include consumer group information, probably worth expanding on that.
|
@swamp0407 you did remove the |
|
The lookupKeyRead behavior is weird, but it looks like it's well established in other places, so I guess we should keep that consistent. Still a couple of other open comments. @swamp0407 |
3ff83a5 to
6578c90
Compare
6578c90 to
35e990d
Compare
oranagra
left a comment
There was a problem hiding this comment.
haven't yet reviewed the streams code.
i think the fix for DEBUG DIGEST and steams can be a separate PR.
unless this one really needs it in order to validate correct result.
maybe you can use XINFO FULL instead for now.
|
Thank you for reviewing my code. @oranagra Please check it out as I have corrected it. And, I don't need to use the stream consumer group's digest, so I won't touch it. |
4002ad2 to
22bcc37
Compare
oranagra
left a comment
There was a problem hiding this comment.
few more comments..
btw, it may be a good idea to move all the 'dupXxxxObject` functions to their respective type c files eventually.
all this type specific logic sounds like it shouldn't be in object.c.
but let's do that after we're done with the other comments, for an easier review of everyone involved.
1efd8df to
ad02af3
Compare
|
thanks @oranagra I wrote the code in reference to streamReplyWithRange in t_stream.c, but I didn't understand the streamReplyWithRange function correctly, so the part about adding nack to the group and consumer pel got complicated. After reading the code again, I thought that the same key nack would never go into multiple people's pel. I also fixed the part about creating a new consumer. |
|
@swamp0407 looks like i responded to your last push before you submitted your last message. |
|
Before we seal this one, I have a couple of notes:
|
|
|
WRT 1, I guess I meant variadic keys, something like |
|
ohh... |
|
I don't like the multi-key approach when there are flags involved, it really complicates the command. As oran said you can always multi-exec them. I also agree that we can add flags later as needed. From my understanding the follows up here are:
Since neither of these require a major consensus, I am OK with the current iteration. @redis/core-team conensus? |
Co-authored-by: Itamar Haber <[email protected]>
oranagra
left a comment
There was a problem hiding this comment.
i went over all the comments to check that we didn't forget anything, found another minor issue.
other than that:
- revert the additional "del" keyspace notification
- and move all the "dupXxxx" functions to their respective C files. try to find the correct place in each C file for this kind of API (not part of the commands section), and make sure to give them the right prefix. please do this refactory in a separate commit, so it'll be easy to review actual changes.
after that, i guess we're ready to merge this.
| } else if (!strcasecmp(c->argv[j]->ptr, "db") && additional >= 1) { | ||
| if (getLongLongFromObject(c->argv[j+1], &dbid) == C_ERR || | ||
| dbid < INT_MIN || dbid > INT_MAX || | ||
| selectDb(c, dbid) == C_ERR) |
There was a problem hiding this comment.
this trick of using selectDb to check if the dbid is in range is not very good.
if we exit with syntax error on the next argument, the selected db remains the dest db.
either re-select the original db right away, or just match the dbid range manually.
|
@swamp0407 thank you. merged. |
Syntax: COPY <key> <new-key> [DB <dest-db>] [REPLACE] No support for module keys yet. Co-authored-by: tmgauss Co-authored-by: Itamar Haber <[email protected]> Co-authored-by: Oran Agra <[email protected]>
I'm not used to using git and I'm not familiar with how to do PR, so I'm sorry if I made a mistake.
Syntax:
COPY <key> <new-key> [DB <dest-db>] [REPLACE]see #6599
Co-authored-by: tmgauss
I'm not very good at English, so there may be something wrong with the grammar of the comments in the code, etc. I'm sorry, but please check.