Add support for `HGETALL.WATCH` command
Add support for reactive queries on the existing HGETALL command by introducing HGETALL.WATCH.
This command should send push-responses to subscribed clients whenever the data inside the respective hash set changes.
As a part of this feature, you are also required to add support for the same to the dicedb-go SDK inside the watch_command.go file.
Reference
- You may refer to #1047 to understand the changes required to support this command.
- #924 provides more background on the feature's underlying implementation (but may not be directly relevant to this issue)
Testing
- Ensure integration tests are added, you can refer to existing
.WATCHintegration tests. - Integration tests should include both resp tests and SDK tests.
Hi! Can I please work on this issue? Thank you : )
Hi! Can I please work on this issue? Thank you : )
Assigned.
Hi, could you please allow me to work on this issue?
Hey @JyotinderSingh let me know the issue is still open, can take a quick look.
Hey @arpit1912 ! I was working on it but I kinda got stuck on how to test my changes. I'm new so it took me longer than expected. Would you mind allowing me more time to look into this issue? Thank you.
Hey @arpit1912 ! I was working on it but I kinda got stuck on how to test my changes. I'm new so it took me longer than expected.
Would you mind allowing me more time to look into this issue? Thank you.
Take your time. Feel free to ask on discord.
Hey @arpit1912 ! I was working on it but I kinda got stuck on how to test my changes. I'm new so it took me longer than expected. Would you mind allowing me more time to look into this issue? Thank you.
Please do, I'm also new here and was just checking for an issue to work upon. Let me know if there is anything you want to discuss . Thanks!
are you still working on this issue @src1026?
are you still working on this issue @src1026? If not I can take this up @JyotinderSingh .
@asaurabh12 and I working on this issue and we have understood few parts of the solution
- We need to modify the https://github.com/DiceDB/dice/blob/master/internal/iothread/cmd_meta.go by configuring the HGETALL WATCH AND UNWATCH
- In this file https://github.com/DiceDB/dice/blob/master/internal/watchmanager/watch_manager.go#L45, should we add
dstore.HSET: {dstore.HGETALL: struct{}{}}This signifies that for any HSET operation we have to call HGETALL.
Please let me know if our understand is correct @JyotinderSingh @arpit1912 .
@asaurabh12 and I working on this issue and we have understood few parts of the solution
We need to modify the https://github.com/DiceDB/dice/blob/master/internal/iothread/cmd_meta.go by configuring the HGETALL WATCH AND UNWATCH
In this file https://github.com/DiceDB/dice/blob/master/internal/watchmanager/watch_manager.go#L45, should we add `dstore.HSET: {dstore.HGETALL: struct{}{}}
` This signifies that for any HSET operation we have to call HGETALL.
Please let me know if our understand is correct @JyotinderSingh @arpit1912 .
Correct
@asaurabh12 and I working on this issue and we have understood few parts of the solution
- We need to modify the https://github.com/DiceDB/dice/blob/master/internal/iothread/cmd_meta.go by configuring the HGETALL WATCH AND UNWATCH
- In this file https://github.com/DiceDB/dice/blob/master/internal/watchmanager/watch_manager.go#L45, should we add `dstore.HSET: {dstore.HGETALL: struct{}{}}
` This signifies that for any HSET operation we have to call HGETALL. Please let me know if our understand is correct @JyotinderSingh @arpit1912 .
Correct
@JyotinderSingh: Thanks for getting back, @Nachiket18 and I have implemented the following:
- Contants.go, watch_manager.go and cmd_meta.go files were changed on the fork
- Checked further in ZRange implementation, and found different code structures for eval.go, there is already implementation of HGETALL in eval.go, we need further clarification on how to proceed with this file.
@asaurabh12 and I working on this issue and we have understood few parts of the solution
- We need to modify the https://github.com/DiceDB/dice/blob/master/internal/iothread/cmd_meta.go by configuring the HGETALL WATCH AND UNWATCH
- In this file https://github.com/DiceDB/dice/blob/master/internal/watchmanager/watch_manager.go#L45, should we add `dstore.HSET: {dstore.HGETALL: struct{}{}}
` This signifies that for any HSET operation we have to call HGETALL.
Please let me know if our understand is correct @JyotinderSingh @arpit1912 .
Correct
@JyotinderSingh: Thanks for getting back, @Nachiket18 and I have implemented the following:
Contants.go, watch_manager.go and cmd_meta.go files were changed on the fork
Checked further in ZRange implementation, and found different code structures for eval.go, there is already implementation of HGETALL in eval.go, we need further clarification on how to proceed with this file.
Just create a PR and we can discuss there. This shouldn't require too many changes. Feel free to take a look at the past PRs for adding watch support to other commands.
I created a PR (https://github.com/DiceDB/dice/pull/1405) @JyotinderSingh . We are following ZRANGEWATCH PR and making the changes.