* 1. Add a Yield() call before executing the last command in the async queue when needed.
2. Allow the receive buffer to grow when needed.
3. Improve debugging logs for batching behavior.
* Update helio and use the new epoch interface for deciding on yields.
Add double to string coversion tests.
Patch the library to avoid using locale - because freebsd c++ lib
does not have this symbol.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
1. Do not use IOUring on non-linux systems.
2. Improve compatibility of the code for non-linux systems.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* fix(server): Dont apply memory limit when loading/replicating
When loading a snapshot created by the same server configuration (memory and
number of shards) we will create a different dash table segment directory tree, because the
tree shape is related to the order of entries insertion. Therefore when loading data from
snapshot or from replication the conservative memory checks might fail as the new tree might
have more segments. Because we dont want to fail loading a snapshot from the same server
configuration we disable this checks on loading and replication.
Signed-off-by: adi_holden <adi@dragonflydb.io>
There was a bug on updates of the acl categories when squashing was used. Basically, the parent context could be accessed in parallel by the "stub" contexts causing a dreaded data race on the update.
This is fixed by adding a new AclUpdateMessage at the front of the dispatch queue of the connection.
fix: use "cd" instead of woarking-directory that does not work
Also, use GITHUB_WORKSPACE due to https://github.com/actions/runner/issues/2058
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Introduced `max_multi_bulk_len` as a max limit when parsing RESP arrays
as well as `max_client_iobuf_len` as a max limit on the iobuf used to
read from a socket.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* remove locking the registry when Validating users
* deep copies the acl categories in the connection context
* streamline updates to the acl categories via the proactor pool
1. No logic was changed during refactoring.
2. Flipped the flag to run regression tests for now own with zset_tree=on
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Change the Makefile to configure the compile to produce code
compatible with core2 architecture for x86_64 systems.
Plus specify precise CPU extensions that we use in the code.
Partly addresses #1519
Before the change we relied on default helio logic that configured
the build to run on sandybridge for x86_64.
This PR overrides x86_64 settings to much older core2 processor.
Also, we remove an unneeded cmake include.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
the bug: when command is renamed we show the rename command in command
stats
the fix: print the origin command name in command stats
Signed-off-by: adi_holden <adi@dragonflydb.io>
* fix DispatchCommand error reporting when memcached protocol is used (one example is when we use SET command on the replica -- previously we crashed now we properly report an error)
* SendError(ErrorReply) moved to SinkReplyBuilder from RedisReplyBuilder
* SendError(OpStatus) moved to SinkReplyBuilder from RedisReplyBuilder
* added tests for SendError(ErrorReply) in RedisReplyBuilder
* fix: add master metric
the role metric is hard to work with as it generates two time serieses,
for each of the role label values.
Will remove the role metric once we update the production versions.
---------
Signed-off-by: ashotland <ari@dragonflydb.io>
* feat: implement CONFIG GET command
The command returns all the matched arguments and their current values.
In addition, this PR adds mutability semantics to each config - whether it can be
changed at runtime.
Fixes#1700
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
---------
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
While loading rdb snapshot, if oom is reached a bad alloc exception is thrown. Now we
catch it and write warning to log and fali loader.
Signed-off-by: adi_holden <adi@dragonflydb.io>
* feat(server): Support limiting the number of open connections.
* * Update helio after the small fix was merged to master
* Don't limit admin connections (and add a test case)
* Resolve CR comments
1. If the first request sent to the connection is large (2kb or more)
Dragonfly was closing the connection.
2. Changed server side error reporting according to memcache protocol:
https://github.com/memcached/memcached/blob/master/doc/protocol.txt#L172
3. Fixed the wrong casting in DispatchCommand.
4. Remove practically unused code that translated opstatus to strings.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* feat(server): support multi eval in lock ahead mode
1. remove validation to allow multi eval only in global script mode
2. send error if there is a mode conflict when running eval inside multi
3. reset uniqe_keys_ when transaction finishes
If an empty buffer is passed to the socket Recv function - it returns error 103.
Even if we returned success, this would lead to the endless loop since the parser
requires more data to parse the load.
Fixes#1680
Signed-off-by: Roman Gershman <roman@dragonflydb.io>