Commit graph

49 commits

Author SHA1 Message Date
Borys
0e116b1535
fix: slot calculation during transaction squashing (#4460) 2025-01-15 11:43:52 +00:00
Borys
933c9f0b1c
refactor: remove transaction lib on cluster code dependency (#4417) 2025-01-08 09:38:13 +00:00
Borys
f663f8e841
fix: provide resp3 option to CapturingReplyBuilder (#4400) 2025-01-05 14:16:02 +02:00
Shahar Mike
779bba71f9
fix: Fix test_network_disconnect_during_migration test (#4224)
There are actually a few failures fixed in this PR, only one of which is a test bug:

* `db_slice_->Traverse()` can yield, causing `fiber_cancelled_`'s value to change
* When a migration is cancelled, it may never finish `WaitForInflightToComplete()` because it has `in_flight_bytes_` that will never reach destination due to the cancellation
* `IterateMap()` with numeric key/values overrode the key's buffer with the value's buffer

Fixes #4207
2024-12-02 15:55:23 +02:00
Borys
4e7800f94f
fix: UB during cmd squashing reply size calculation (#4149)
* fix: UB during cmd squashing reply size calculation

* feat: add promtheus metric commands_squashing_replies_bytes
2024-11-19 13:40:30 +02:00
Borys
e16ef838e4
feat: add INFO memory section for squashing replies memory consuming (#4147)
* feat: add INFO memory section for squashing replies memory consuming

* refactor: address comments
2024-11-18 21:16:41 +02:00
adiholden
db67b35f8e
fix server: fix stats of pipeline squashed commands (#4132)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-11-14 20:57:05 +02:00
Vladislav
eadce55b67
chore: remove old io (#3953)
* chore: Remove old IO

* fix: fix last error accounting
* chore: use unique_ptr<char> in MGetResponse storage

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-11-10 11:56:41 +02:00
Roman Gershman
8d61a91200
chore: pass reply_builder explicitly to pubsub module (#4021)
Also, deprecate `reply_builder()` access method.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-11-04 19:20:12 +02:00
Roman Gershman
6f6897cef1
chore: pass RedisReplyBuilder explicitly from dragonfly connection (#4009)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-10-29 14:52:09 +02:00
adiholden
7df95dfb6e
fix server: fix last error reply (#3728)
fix 1: in multi command squasher error message was not set therefore it was not printed to log on the relevant command only on exec, fixed by setting the last error in CapturingReplyBuilder::SendError
fix 2: non clearing cached error replies before the command is Invoked

---------

Signed-off-by: adi_holden <adi@dragonflydb.io>
Co-authored-by: kostas <kostas@dragonflydb.io>
2024-09-23 11:34:13 +03:00
Vladislav
1f36c9952d
chore(io): Introduce (carefully) new io with use_new_io flag (#3513)
Plugs in new IO, must be reverted after successful testing
2024-08-16 16:56:04 +03:00
Roman Gershman
93f6773297
chore: reduce pipelining latency by reusing existing shard fibers (#3494)
* chore: reduce pipelining latency by reusing existing shard fibers

To prove the benefits, run `./dfly_bench --pipeline=50   -n 20000  --ratio 0:1  --qps=0  --key_maximum=1`
Before: the average pipelining latency was 10ms
After: the average pipelining latency is 5ms.
Avg latency: pipelined_latency_usec / total_pipelined_squashed_commands

Also, improved counting of squashed commands - to count actual squashed ones.
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-08-14 14:45:54 +03:00
Vladislav
be59b5eeb4
chore: Make KeyIndex iterable (#3326) 2024-07-19 14:23:46 +03:00
Shahar Mike
18ca61d29b
feat(namespaces): Initial support for multi-tenant (#3260)
* feat(namespaces): Initial support for multi-tenant #3050

This PR introduces a way to create multiple, separate and isolated
namespaces in Dragonfly. Each user can be associated with a single
namespace, and will not be able to interact with other namespaces.

This is still experimental, and lacks some important features, such as:
* Replication and RDB saving completely ignores non-default namespaces
* Defrag and statistics either use the default namespace or all
  namespaces without separation

To associate a user with a namespace, use the `ACL` command with the
`TENANT:<namespace>` flag:

```
ACL SETUSER user TENANT:namespace1 ON >user_pass +@all ~*
```

For more examples and up to date info check
`tests/dragonfly/acl_family_test.py` - specifically the
`test_namespaces` function.
2024-07-16 19:34:49 +03:00
adiholden
ccada875e0
feat(server): master stop sending exec opcode to replica (#3289)
* feat server: master stop sending exec opcode to replica

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-07-09 14:48:31 +03:00
Kostas Kyrimis
3f8c8176cb
feat: add noloop subcommand in client tracking (#3164)
* add noloop subcommand
2024-06-11 14:15:10 +00:00
Kostas Kyrimis
0edcbc80ef
chore: recommit client tracking (#3136)
* bring back client tracking
* disable all client commands in squashing
* allow all client commands in multi/exec block
2024-06-07 15:34:44 +03:00
Borys
0dea257f41
fix: fix cluster incorrect keys status (#3083)
* fix: fix cluster incorrect keys status
2024-05-26 15:10:01 +03:00
Borys
2230397a12
refactor: add cluster namespace (#2948)
* refactor: add cluster namespace, remove extra includes
2024-04-22 21:45:43 +03:00
Roman Gershman
7e0536fd4c
chore: remove core/fibers (#2723)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-03-14 12:02:33 +00:00
Kostas Kyrimis
c8871896d7
fix: access to wrong thread local after command migrates fiber to a different thread (#2410)
* fix: access to wrong thread local after command migrates fiber to a different
thread
2024-01-17 08:19:10 +02:00
Shahar Mike
4874da8b5b
feat(cluster): Add RestoreStreamer. (#2390)
* feat(cluster): Add `RestoreStreamer`.

`RestoreStreamer`, like `JournalStreamer`, streams journal changes to a
sink. However, in addition, it traverses the DB like `RdbSerializer` and
sends existing entries as `RESTORE` commands.

Adding it required a bit of plumbing to get all journal changes to be
slot-aware.

In a follow-up PR I will remove the now unneeded `SerializerBase`.

* Fix build

* Fix bug

* Remove unimplemented function

* Iterate DB, drop support for db1+

* Send FULL-SYNC-CUT
2024-01-10 15:10:21 +02:00
Roman Gershman
fc1a70598d
fix "debug exec" command (#2354)
fix: fix "debug exec" command

It used mutex lock inside Await callback which is prohibited.

In addition, we improved loggings across the transaction code.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-01-01 18:29:20 +02:00
Roman Gershman
bd7a02d474
feat: track differrent patterns of multi/exec transactions (#2334)
* feat: track differrent patterns of multi/exec transactions

This information is exposed via "DEBUG EXEC" command.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>

* chore: address comments + add basic squasher stats

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-12-25 12:22:24 +02:00
Roman Gershman
d88b2422de
chore: eliminate most of clang++ warnings (#2288)
Not all of them but 90% is done.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-12-11 12:47:53 +02:00
Kostas Kyrimis
8323c82dc5
feat(acl): add acl keys to acl save/load (#2273)
* add acl keys to acl savel/load
* add tests
2023-12-08 16:08:33 +00:00
Kostas Kyrimis
2703d4635d
feat(acl): add validation for acl keys (#2272)
* add validation for acl keys
* add tests
2023-12-08 17:28:53 +02:00
Borys
33d0879416
refactor: conn_context and reply_builder refactoring (#2251)
* refactor: conn_context and reply_builder refactoring
2023-12-06 08:23:32 +02:00
Vladislav
b403416be0
chore: raise pipeline squashing limit (#2095)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-10-31 00:33:32 +03:00
Vladislav
4b387cebe2
fix(server): Exclude eval from pipeline squashing (#2027)
* fix(server): Exclude eval from pipeline squashing

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-10-16 17:48:42 +03:00
Vladislav
cb9a45f2a9
fix(server): Don't recompute shard for squashed stub tx (#2017)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-10-15 09:27:58 +03:00
Kostas Kyrimis
cbba6f4e11
fix(acl/admin_port): skip acl validation on admin port (#1997)
* skip all acl related functionality on admin port
2023-10-10 08:28:07 +03:00
Vladislav
c65b9cf63d
fix: Fix squashing, pytest arg formatting (#1712)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-08-18 09:28:19 +03:00
Vladislav
71fa2f275e
fix: MONITOR now works for multi transactions (#1675)
* fix: fix monitoring for multi transactions

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-08-17 12:50:16 +03:00
Vladislav
b9e8a2c0da
chore: Connection fixes (#1663)
* chore: Connection safety checks

Signed-off-by: Vladislav <vlad@dragonflydb.io>
2023-08-09 17:57:41 +03:00
Vladislav
16e512c60d
feat: Refactor command verification before execution (#1652)
* feat: Refactor verifications

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-08-08 12:36:31 +03:00
Vladislav
6faa530d42
fix: Add selective non-atomic squash dispatch (#1641)
fix: Add selecting non-atomic squash dispatch

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-08-06 10:08:55 +03:00
Vladislav
a0da723628
fix: remove coordinator_index_ from tx & fix short circuit (#1640)
fix: remove coordinator_index_ from tx

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-08-03 22:43:43 +03:00
Vladislav
844fe57dec
feat: Remove batch locks from non-atomic squashing (#1613)
feat: Remove batch locks from non-atomic squashing

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-08-02 09:16:47 +03:00
Roman Gershman
b09a36d553
feat: ignore MULTI/EXEC if the transaction consists of EVAL commands (#1157)
feat: ignore MULTI/EXEC if the transaction consists of EVAL commands.

Together with `default_lua_config` solves #781.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-04-29 13:55:32 +02:00
Vladislav
74a1454409
Collect errors from async lua calls (#1092)
Error collection from async calls
2023-04-22 09:02:22 +03:00
Vladislav
b345604226
fix: Remove incremental locking (#1094) 2023-04-15 06:59:19 -07:00
Vladislav
70cf436c05
Lua script async calls (#1070)
Introduces squashing for scripts and a new `redis.acall` command for async commands
2023-04-12 23:37:25 +03:00
Vladislav
282c168d34
fix: Update cntx->cid on multi-tx'es (#1081)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-04-12 23:28:31 +03:00
Roman Gershman
ee24029148
feat: enable multi-tx squashing. (#1074)
Make blpop test pass with squashing. The problem was that the txid was not properly reported
back to the testing code.

Also, fixed redundant codepath for defragmentation.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-04-12 16:15:35 +03:00
Vladislav
015ed622c5
fix(server): Optimize StoredCmd (#1053)
Opmitize StoredCmd to allow inline storage
2023-04-11 10:14:36 +03:00
Vladislav
a12ddfe108
Remove cmd name from args (#1057)
chore: remove cmd name from the list of arguments

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
Co-authored-by: Roman Gershman <roman@dragonflydb.io>
2023-04-10 14:14:52 +03:00
Vladislav
c29db83b7e
feat(server): Squashed exec (#1025)
Introduces squashed executor that allows squashing single-shard commands within multi transactions
2023-04-08 23:34:33 +03:00