Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for GET.UNWATCH command #998

Closed
JyotinderSingh opened this issue Oct 7, 2024 · 9 comments · Fixed by #1201
Closed

Add support for GET.UNWATCH command #998

JyotinderSingh opened this issue Oct 7, 2024 · 9 comments · Fixed by #1201
Assignees

Comments

@JyotinderSingh
Copy link
Collaborator

GET.WATCH unsubscribes from a GET.WATCH subscription.

@nm123github
Copy link
Contributor

Hey @JyotinderSingh, was planning to give this a try. Are GET.WATCH, GET.UNWATCH command's that can be called from the cli client? I get

127.0.0.1:7379> GET.WATCH k1
(error) ERR unknown command 'GET.WATCH', with args beginning with: k1

@JyotinderSingh
Copy link
Collaborator Author

Hey @JyotinderSingh, was planning to give this a try. Are GET.WATCH, GET.UNWATCH command's that can be called from the cli client? I get


127.0.0.1:7379> GET.WATCH k1

(error) ERR unknown command 'GET.WATCH', with args beginning with: k1

The CLI does not yet support these commands, however that should not stop you from being able to execute them (it only means that you wouldn't receive reactive updates from the server).
The reason why you're seeing this error is because you are not running the server in multithreaded mode.

@nm123github
Copy link
Contributor

nm123github commented Oct 14, 2024

Yes, worked when i executed in multithreaded mode. Few questions,

  • My understanding of GET.WATCH is that its similar to WATCH in redis. Meaning if we're watching a variable being used inside a transaction, and if any other connected client changed its value the transaction (for the first client) wont succeed. Is that a correct understanding?

  • To test this, i was trying to use transactions in multithreaded mode. Noticed a segmentation fault when i tried to EXEC a transaction (only in multithreaded mode). Is this still work in progress?

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x100e3b39]

goroutine 11 [running]:
github.com/dicedb/dice/internal/eval.ExecuteCommand(0xc00048a5d0, 0x0, 0xc0000b2100, 0x0, 0x0)
	/Users/username/projects/dice/internal/eval/execute.go:51 +0x579
github.com/dicedb/dice/internal/shard.(*ShardThread).processRequest(0xc0000d61c0, 0xc0006bc340)
	/Users/username/projects/dice/internal/shard/shard_thread.go:92 +0x45

@JyotinderSingh
Copy link
Collaborator Author

Yes, worked when i executed in multithreaded mode. Few questions,

  • My understanding of GET.WATCH is that its similar to WATCH in redis. Meaning if we're watching a variable being used inside a transaction, and if any other connected client changed its value the transaction (for the first client) wont succeed. Is that a correct understanding?

  • To test this, i was trying to use transactions in multithreaded mode. Noticed a segmentation fault when i tried to EXEC a transaction (only in multithreaded mode). Is this still work in progress?


panic: runtime error: invalid memory address or nil pointer dereference

[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x100e3b39]



goroutine 11 [running]:

github.com/dicedb/dice/internal/eval.ExecuteCommand(0xc00048a5d0, 0x0, 0xc0000b2100, 0x0, 0x0)

	/Users/username/projects/dice/internal/eval/execute.go:51 +0x579

github.com/dicedb/dice/internal/shard.(*ShardThread).processRequest(0xc0000d61c0, 0xc0006bc340)

	/Users/username/projects/dice/internal/shard/shard_thread.go:92 +0x45

Transactions are not yet supported in multi threaded mode.

@psrvere
Copy link
Contributor

psrvere commented Oct 16, 2024

@JyotinderSingh - please assign this to me.

@JyotinderSingh
Copy link
Collaborator Author

@JyotinderSingh - please assign this to me.

Done.

@psrvere
Copy link
Contributor

psrvere commented Oct 23, 2024

Starting work on this from today.

@JyotinderSingh
Copy link
Collaborator Author

Starting work on this from today.

Awesome, thanks for the update!

@psrvere
Copy link
Contributor

psrvere commented Nov 1, 2024

Raised PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants