1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-15 17:51:06 +00:00
Commit graph

1713 commits

Author SHA1 Message Date
Roman Gershman
365cb439cf
chore: remove support for save_schedule flag (#2327)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-12-22 11:17:18 +02:00
Shahar Mike
34986fc52e
feat(server): Account for RObj concrete objects (#2324)
* feat(server): Account for RObj concrete objects

* proper `delete`
2023-12-22 09:20:41 +02:00
Shahar Mike
4929e3c777
feat(server): Better accounting of DenseSet memory (#2325) 2023-12-21 19:26:16 +02:00
Yue Li
6905389d60
feat(server): Support CLIENT TRACKING subcommand (2/2) (#2280)
fixes https://github.com/dragonflydb/dragonfly/issues/2139

This is part two that implements the logic which notifies tracking clients by sending invalidation messages:

- The client tracking state is set by CLIENT TRACKING subcommand as well
as upon client disconnection.

- Track the keys of a readonly command by maintaining mapping that maps
keys to the sets of tracking clients.

- Send invalidation messages to clients when their tracked keys are
updated.

- Make PerformDeletion a member function of DbSlice, and send 
invalidation message within the function.

- Mock the function for sending invalidation message to avoid test
crash due to lack of real listener in the testing framework.

- Add functional (some) tests for client tracking based on the mocked interfaces.

---------

Signed-off-by: Yue Li <61070669+theyueli@users.noreply.github.com>
2023-12-21 04:40:21 -08:00
Borys
fd76c51310
feat: add command flow for slot migration process (#2292)
* feat(cluster): add command flow for slot migration process
fixes #2295

DFLYMIGRATE FLOW command was added to establish
connections for every shard replication process.
Slow serialization step is the separate issue so
for now only eof_token is sent for reply to
DFLYMIGRATE FLOW command.
Expected state for START-SLOT-MIGRATION is FULL_SYNC now.
2023-12-20 18:47:11 +02:00
adiholden
6398a73942
fix(bug): access invalid prime table iterator (#2300)
The bug:
When running dragonfly in cache mode we bump up items on dash table when we find them. If we access few items on the callback that reside next to each other we will invalidate the first found iterator.

The fix:
After we bump up entry we insert the prime table ref to bump set. When checking if we can bump down an item we check the item is not in this set. Once we finish running the transaction callback we clear the set.

Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-12-20 13:05:29 +02:00
Shahar Mike
6c32c8004d
refactor(server): Make FindFirst() read-only (#2317)
* refactor(DbSlice): Replace `FindExt()` with `FindMutable()` and `FindReadOnly`

* fix

* `ExpireConstIterator`

* Don't update stats on FindMutable()

* auto&

* FindFirst

* Remove old Find() method
2023-12-20 09:53:52 +02:00
Shahar Mike
0e4d76cc96
refactor(DbSlice): Replace FindExt() with FindMutable() and FindReadOnly (#2308)
* refactor(DbSlice): Replace `FindExt()` with `FindMutable()` and `FindReadOnly`

* fix

* `ExpireConstIterator`

* Don't update stats on FindMutable()

* auto&

* ReadOnly

* Remove redundant call

* move() before

* Remove redundant post_updater

* Update comment
2023-12-20 08:04:39 +02:00
Shahar Mike
6c3c7b152a
fix(server): Track all IoBuf capacity changes in Connection (#2309)
feat(server): Always track resizing of connection IoBuf
2023-12-19 15:12:14 +02:00
adiholden
543e8fc3a8
feat(replica): add master id on replica output for info replication (#2314)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-12-19 11:17:35 +02:00
Shahar Mike
b17aae95a5
feat(server): Add dispatch queue bytes to /metrics (#2310) 2023-12-18 21:07:31 +02:00
Shahar Mike
dcedd1645e
feat(server): Convert DbSlice's AddOr* to return AutoUpdater (#2290)
* fix(server): Use AutoUpdater with AddOr* methods

* Remove explicit calls

* `operator=`

* return *this

* PostUpdate twice

* exp it

* bitops

* remove explicit `Run()`

* Explicitly `delete` copy ops

* Remove `AddOrSkip()`
2023-12-17 15:00:10 +02:00
Vladislav
aaf01d4244
feat(cluster): Cancel blocking commands on cluster update (#2255)
Handle blocking commands during cluster config update

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-12-17 15:32:35 +03:00
Roman Gershman
e4da54fdeb
chore: update helio library (#2305)
Merged in the recent improvements to helio's fibers/iouring library.
2023-12-17 10:52:48 +02:00
Shahar Mike
8e10c5d88d
refactor(server): Refactor AddOrFind() (#2299)
* refactor(server): Reuse `PreUpdate()` internally

This actually fixes a bug where we did not handle tiering upon
expiration if found via `AddOrFind2()`.

Related to #2252

* Simplify code, remove optimization

* Don't do double lookups

* stats

* PreUpdate()--

* fixes
2023-12-17 10:37:54 +02:00
Shahar Mike
a98ba6a0f8
fix(memory): Add missing fields in connection memory (#2306)
While at it, fix initialization of replication info, to correctly
account for replication connections.
2023-12-17 10:37:35 +02:00
s-shiraki
bd3e57d262
feat(server): Implement NUMSUB subcommand (#2282)
* feat(server): Implement NUMSUB subcommand

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix: test

* fix: build error
2023-12-16 20:42:15 +02:00
Shahar Mike
4cce3b4a01
feat(server): Better reporting of per-type memory in /metrics (#2303) 2023-12-14 14:41:25 +02:00
Vladislav
e273f7a2b8
fix(server): handle no-key-transactional commands in multi/exec (#2279)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-12-12 19:34:02 +03:00
Vladislav
7ca07a498f
fix(server): Fix client pause and add test (#2298)
Fixes a bug in which we incorrectly determined paused dispatches, which led to not allowing multiple (overlapping) client pauses
2023-12-12 19:28:48 +03:00
Kostas Kyrimis
8640edad71
feat(acl): add acl keys to acl log command (#2274)
* add acl keys to acl log command
* add tests
2023-12-12 17:00:41 +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
adiholden
dc3bc9e92f
fix(tiering): fix tiering crash on setting expire (#2285)
fixes #2224
the bug: when updateing entry pre update will resets the PrimeValue if
this is an external entries leading to crash if we insert entries with expire
time.

the fix: reserve the expire mask in PrimeValue on pre update

Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-12-11 10:29:12 +02:00
Shahar Mike
1ce3f983c9
WIP: Auto PostUpdate() (#2268)
* WIP: Auto `PostUpdate()`

* More `Find()` uses

* Final touches

* Fixes

* Fix bug and allow reassigning

* Rename to AutoUpdater

* Fix and add DCHECK

* Also check deletion count

* Use ccache instead of sccache

* Try to upgrade Helio

* off64_t

* off64_t

* Revert changes to CI
2023-12-11 10:07:53 +02:00
Roman Gershman
c183bf69aa
chore: update helio (#2286)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-12-11 09:31:54 +02:00
Roman Gershman
ff562897eb
fix: accept '-' character when parsing json fields (#2271)
Fixes #2265
Also switch to our own fork of jsoncons instead of using patches.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-12-10 09:32:52 +02:00
Yue Li
64bbfc7063
feat(server): Support CLIENT TRACKING subcommand (1/2) (#2277)
The client tracking state is set by CLIENT TRACKING subcommand as well
as upon client disconnection.

Track the keys of a readonly command by maintaining mapping that maps
keys to the sets of tracking clients.
2023-12-08 23:13:55 -08: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
Kostas Kyrimis
8126cf8252
feat(acl): add acl keys to acl list command (#2261)
* add acl keys to acl list
2023-12-08 15:32:15 +03:00
Kostas Kyrimis
87ec0a1d65
feat(acl): add acl keys to acl get command (#2260)
* add acl keys to acl get command
* add tests for acl keys parsing
2023-12-08 10:42:27 +00:00
Kostas Kyrimis
b642fb6901
feat(acl): add acl keys to acl setuser command (#2258)
* add parsing of ACL keys
* add ACL keys to acl setuser command
2023-12-08 09:53:22 +00:00
Shahar Mike
636507c356
feat(server): Return per-type memory breakdown from INFO and /metrics (#2262)
* feat(server): Return per-type memory breakdown from INFO and /metrics

* OBJ_TYPE_MAX

* Move AddTypeMemoryUsage, use it from TieredStorage

* Remove strval_memory_usage

* Remove redundant strval_bytes

---------

Signed-off-by: Shahar Mike <chakaz@users.noreply.github.com>
2023-12-07 21:37:09 +02:00
adiholden
be82c11428
fix(tiering): fix crash when item was deleted before offloaded (#2225)
* fix(teiring): fix crash when item was deleted before offloaded

The bug: On insert key is inserted to bin peinding entries, if this key
was deleted we would check fail on finding this item when tring to flush
bin entries.

The fix: On every insert to bin pending entries erase pending entreis
which were delted or expired

Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-12-07 20:38:23 +02:00
Kostas Kyrimis
74cc58dc4c
feat(acl): add storage for acl keys (#2257)
* add storage for acl keys
2023-12-07 19:34:06 +02:00
Yue Li
f89b65ca87
feat(Server):support Verbatim strings resp type, using it for CLIENT LIST and INFO commands (#2264)
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>
2023-12-06 21:07:25 -08:00
Yue Li
bf0f7ec234
bug(hset): make hrandfield reply match Redis (#2266)
fixes #2249
2023-12-06 11:20:02 -08:00
Roman Gershman
1037f446a2
chore: add a test demonstrating on how to pass a dash within json path (#2267) 2023-12-06 19:24:15 +02:00
Yue Li
2e914efb52
bug(server): remove CO::READONLY for QUIT command. (#2263)
remove readonly for QUIT command.
2023-12-06 18:23:35 +02:00
Vladislav
5f58b3aafa
fix(connection): Add WeakRef to replace pubsub wait token (#2227)
Add WeakRef to connection to allow tracking it

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-12-06 12:07:31 +03: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
romange
1900e499ba chore(helm-chart): update to v1.13.0 2023-12-05 15:22:54 +00:00
Shahar Mike
3957370485
fix(server): Call PostUpdate from LPUSH even for new keys (#2254) 2023-12-05 14:23:56 +02:00
Vladislav
11ef6623dc
feat: DispatchTracker to replace everything (#2179)
* feat: DispatchTracker

Use a DispatchTracker to track ongoing dispatches for commands that change global state

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-12-05 11:02:11 +03:00
Roman Gershman
f39eac5bca
chore: add benchmarks for a small cloud instance (#1264)
chore: add benchmarks showing single-threded performanc

In addition addressed some questions raised during HN discussions.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-12-04 17:57:57 +02:00
Borys
24b13434cf
feat: add slot-migration-status command (#2239)
* feat: add slot-migration-status command
2023-12-04 12:47:46 +02:00
Vladislav
f17bfaf0ff
fix(search): Small improvements (#2248) 2023-12-03 20:04:47 +03:00
Roman Gershman
26512fdba4
fix: remove string copy in SendMGetResponse (#2246)
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>
2023-12-03 18:14:19 +02:00
Shahar Mike
d45ded3b76
fix(server): Fix crash when using MEMORY STATS commands (#2240)
* fix(server): Fix crash when using MEMORY STATS commands

* Fix
2023-12-01 21:39:32 +02:00
Borys
a57c6dac1e
add new method to CmdArgParser (#2244)
* add new method to CmdArgParser

* refactor: rename method
2023-12-01 17:14:25 +02:00