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

Json.SetAsync is not executed in NRedisStack.Tests.ExampleTests.PipelineExample #379

Open
uglide opened this issue Jan 22, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@uglide
Copy link
Contributor

uglide commented Jan 22, 2025

Steps to reproduce:

  1. Run MONITOR command with redis-cli
  2. Execute NRedisStack.Tests.ExampleTests.PipelineExample

Expected result:

[0 172.20.0.1:58440] "JSON.SET" "person" "$" "{\"name\":\"John\",\"age\":30,\"city\":\"New York\",\"nicknames\":[\"John\",\"Johny\",\"Jo\"]}"
[0 172.20.0.1:48570] "JSON.NUMINCRBY" "person" "$.age" "2"
[0 172.20.0.1:48570] "JSON.CLEAR" "person" "$.nicknames"
[0 172.20.0.1:48570] "JSON.DEL" "person" "$.nicknames"
[0 172.20.0.1:48570] "JSON.GET" "person"

Actual result:

1737537095.502806 [0 172.20.0.1:48570] "SELECT" "0"
1737537095.502831 [0 172.20.0.1:48570] "JSON.NUMINCRBY" "person" "$.age" "2"
1737537095.502834 [0 172.20.0.1:48570] "SELECT" "0"
1737537095.502839 [0 172.20.0.1:48570] "JSON.CLEAR" "person" "$.nicknames"
1737537095.502842 [0 172.20.0.1:48570] "SELECT" "0"
1737537095.502846 [0 172.20.0.1:48570] "JSON.DEL" "person" "$.nicknames"
1737537095.502848 [0 172.20.0.1:48570] "SELECT" "0"
1737537095.502857 [0 172.20.0.1:48570] "JSON.GET" "person"

Pipeline doesn't execute JSON.SET command and injects "SELECT" command after each command which is super expensive and might be a reason why JSON.SET is getting lost somehow.

@uglide uglide added the bug Something isn't working label Jan 22, 2025
@atakavci
Copy link
Collaborator

atakavci commented Jan 28, 2025

it turns out SE.Redis sends a SELECT 0 after each time an ExecuteAsync or Execute runs explicitly in the client app

        var db = ConnectionMultiplexer.Connect("localhost:6379").GetDatabase();

        db.StringSet("key1", "abc");
        db.StringSet("key2", "abc");

        await db.ExecuteAsync("set", "explicitCall1", "abc");

        db.StringSet("key3", "abc");
        db.StringSet("key4", "abc");

        db.Execute("set", "explicitCall2", "abc");

        db.StringSet("key5", "abc");
        db.StringSet("key6", "abc");
1738053208.322367 [0 192.168.48.1:55570] "SET" "key1" "abc"
1738053208.323767 [0 192.168.48.1:55570] "SET" "key2" "abc"
1738053208.328989 [0 192.168.48.1:55570] "SET" "explicitCall1" "abc"
1738053208.336072 [0 192.168.48.1:55570] "SELECT" "0"
1738053208.336110 [0 192.168.48.1:55570] "SET" "key3" "abc"
1738053208.336622 [0 192.168.48.1:55570] "SET" "key4" "abc"
1738053208.338578 [0 192.168.48.1:55570] "SET" "explicitCall2" "abc"
1738053208.339415 [0 192.168.48.1:55570] "SELECT" "0"
1738053208.339426 [0 192.168.48.1:55570] "SET" "key5" "abc"
1738053208.339852 [0 192.168.48.1:55570] "SET" "key6" "abc"

i̇ wi̇ll further i̇nvesti̇gate i̇t i̇n SE.Redi̇s

@atakavci
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants