fixes#2242#2253
Reference:
The definition of Redis verbatim strings: https://redis.io/docs/reference/protocol-spec/#verbatim-strings
"For example, the Redis command INFO outputs a report that includes newlines. When using RESP3, redis-cli displays it correctly because it is sent as a Verbatim String reply (with its three bytes being "txt"). When using RESP2, however, the redis-cli is hard-coded to look for the INFO command to ensure its correct display to the user."
---------
Signed-off-by: Yue Li <61070669+theyueli@users.noreply.github.com>
* feat: DispatchTracker
Use a DispatchTracker to track ongoing dispatches for commands that change global state
---------
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
chore: add benchmarks showing single-threded performanc
In addition addressed some questions raised during HN discussions.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
fix: eliminate the redundant string copy in SendMGetResponse
Also, allow selectively create DflyInstance in pytests that is attached to
an existing dragonfly port, created outside of tests.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* fix: assign threadlocal data structures during connection migration
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* fix: assign threadlocal data structures during connection migration
Co-authored-by: Shahar Mike <chakaz@users.noreply.github.com>
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
---------
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Co-authored-by: Shahar Mike <chakaz@users.noreply.github.com>
The DF version is being unparseable by Memcached::getVersion() that expects n.n.n string.
Change the version to emulate the old memcached server.
The DF version can still be fetched via Memcached::getStats() function.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Also,
1. rebase helio dependency
2. get rid of varz counters that are superseded by
commands_total/commands_duration_seconds_total metrics
Resolves#2213
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Specifically, allocate only a single blob when returning multiple entries from a shard.
In addition, refactor and unify MGetResponse between string family code and ReplyBuilder code.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
The bug: One connection calls replica start and second call replica stop. In this flow stop first reset state mask state_mask_.store(0), Start sets state mask state_mask_.store(R_ENABLED) continues to greet and create main replication fiber and then stop runs cntx_.Cancel(), which will at later be reset inside the main replication fiber. In this flow main replication fiber does not cancel and the connection calling to Stop is deadlocked waiting to join the main replication fiber.
The fix: run cntx_.Cancel() and state_mask_.store(0) in replica thread.
Signed-off-by: adi_holden <adi@dragonflydb.io>
* chore: add more states to client connections
* fix: clear pipelined messages before close
* fix: skip same thread on backpressure
---------
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
Co-authored-by: Roman Gershman <roman@dragonflydb.io>
Fixes the case where a client library expect SCAN to return quicker
(context: ruby's Rails.cache.delete_matched("prefix_*") times out)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* fix(server): client pause fix on pipeline squash
allow squashing commands on pause
move await on client pause inside InvokeCommand - this way all flows of command invoke will read pause state
Signed-off-by: adi_holden <adi@dragonflydb.io>