1. Fix SendStringArr logic. Consolidate both string_view and string variants to using the same code.
2. Tighten the test framework so that it will test that the parser consumed the whole response.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
1. Make it use vectorized send instead of concatenating everything into a single string.
2. vectorized SendStringArr could fail sending large arrays for lengths higher than 512 (returned EMSGSIZE).
We improved the implementation so it would send those arrays in chunks of 256 items.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
1. Correctly parse keys for EVAL command.
2. Support PUBLISH within lua.
3. Remove spurious failure in debug-mode with the increased verbosity level.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
1. Relax processor requirements for Dragonfly. Fixes#124.
2. Introduce cmake option DF_USE_SSL to allow building DF without SSL support. Fixes#128.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
In rare cases a scheduled transaction is not scheduled correctly and we need
to remove it from the tx-queue in order to re-schedule. When we pull it from tx-queue
and it has been located at the head, we must poll-execute the next txs in the queue.
1. Fix the bug.
2. Improve verbosity loggings to make it easier to follow up on tx flow in release mode.
3. Introduce /txz handler that shows currently pending transactions in the queue.
4. Fix a typo in xdel() function.
5. Add a py-script that reproduces the bug.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
The old code relied on c strtod function that expected some sort of delimiter
at the end. Coincidently my unit-testing code always passed proper c strings so
strod worked as expected. EVAL passes slices to non-c string and this is why the bug was
discovered via eval call. Fixes#148.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* feat(stream): implement xrevrange, xrange, xlen, xinfo and xgroup, xdel.
1. add tests that cover xrange,xrevrange and various error states for xadd.
2. Implement 8 stream commands overall. Fixes#59.
* feat(stream): support xadd/maxlen option
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* Reduce scope of HELLO implementation
Only accept protover=2 as a valid argument as that is
the only thing that is supported at the moment. For all
other arguments degrade to 'unknown command'
The previous implementation creates issues for clients
expecting the presence of the HELLO command to also signal
the presence of RESP3 (as technically the command appeared in
redis at the same time as support for RESP3).
It also did not raise any errors when unsupported (or invalid)
arguments were passed to the command (such as AUTH, SETNAME)
* Fix error in test
* Remove unnecessary context in assertion
* Fix construction of unknown command error string
* Fix casing of error string
* Add tests demonstrating expectations of (p)unsubscribe
- When there are subscriptions the return should contain the count of
remaining channels or patterns subscribed to
- When there are no subscriptions and no arguments are provided
a single response containing null for channel / pattern and count = 0
should be returned
- When there are subscriptions and no arguments are provided
a response per unsubscribed channel or pattern should be returned
* Update arity of (p)unsubscribe commands
* Lint test
* Handle (p)unsubscribe without arguments
Side effects:
- Extract response construction for (p)sububscribe, (p)unsubscribe
into private method
- Use UnsubscribeAll, PunsubscribeAll in cleanup
* Fix linting errors
* Replace ternary with explicit if/else
* Simplify setup for (p)unsubscribe tests
* Update response to HELLO command
Update response from HELLO command to match the api of redis.
Notes:
- For any protocol version other than 2 an error matching what redis
returns for !2,3 is returned
* Add test for redis HELLO command
* Extract version building to GetVersion function
* Update contributors file
* Add HELLO command to README readiness matrix
* Revert "Add HELLO command to README readiness matrix"
This reverts commit 069f590ad0.
* Add HELLO command to api_status document
* Fix `SubscribeMap`
Signed-off-by: Ryan Russell <git@ryanrussell.org>
* Fix `subscriber_arr`
Signed-off-by: Ryan Russell <git@ryanrussell.org>
* Fix `CopySubscribers`
Signed-off-by: Ryan Russell <git@ryanrussell.org>
* Fix `SubscriberMessagesLen`
Signed-off-by: Ryan Russell <git@ryanrussell.org>
* Fix remaining `subscribe` variants
Signed-off-by: Ryan Russell <git@ryanrussell.org>
* Add Ryan Russell to Contributors
Signed-off-by: Ryan Russell <git@ryanrussell.org>
1. Found dangling transaction pointers that where left in the watch queue. Fix the state machine there.
2. Improved transaction code a bit, merged duplicated code into RunInShard function, got rid of RunNoop.
3. Improved BPopper::Run flow.
4. Added 'DEBUG WATCH' command. Also 'DEBUG OBJECT' now returns shard id and the lock status of the object.
1. Fix memory counting stats. Use memory_usable_size(ptr) for counting used memory.
2. Fix crash when there is I/O error when writing snapshot. Now we return error message.