1
0
Fork 0
mirror of https://github.com/dragonflydb/dragonfly.git synced 2024-12-14 11:58:02 +00:00
Commit graph

1864 commits

Author SHA1 Message Date
Roman Gershman
e84bc7586a
chore: reduce Makefile for release procedures only (#2397)
Also, change its build directory to build-release.
Simplify a bit its configuration steps as well. No change in functionality is expected.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-01-11 06:35:57 +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
Vladislav
f4ea42f2f6
chore: simple traffic logger (#2378)
* feat: simple traffic logger

Controls: 
```
DEBUG TRAFFIC <base_path> | [STOP]
```
---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Co-authored-by: Roman Gershman <roman@dragonflydb.io>
2024-01-10 12:56:56 +00:00
Roman Gershman
e9453e62e4
fix: ignore unexpected contents for /sys/fs/cgroup/cpu.max (#2394)
Fixes #2391

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-01-10 11:17:37 +02:00
Vladislav
b8af49cfe5
chore(transaction): Avoid COORD_SCHED_EXEC ambiguity with multi transactions (#2392)
* chore(transaction): Avoid COORD_SCHED_EXEC ambiguity

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-01-10 11:31:11 +03:00
Kostas Kyrimis
0c96f83d1d
fix(regTests): assertion failure during load in cancel_replication_immediately (#2371)
* replace DispatchBrief with Await in SetMasterFlagOnAllThreads
2024-01-09 16:18:40 +02:00
Roman Gershman
1cab6695d7
chore: improvements in dash code (#2387)
chore: cosmetic improvements in dash code

1. Better naming
2. Improve improving the interface of ForEachSlot command
3. Wrap the repeating code of updating the bucket version into the UpdateVersion function

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-01-08 20:21:52 +02:00
Kostas Kyrimis
25d906bce7
feat: allow round robin sharding in non cluster mode (#2364) 2024-01-08 10:51:15 +02:00
adiholden
014a86fc88
feat(lru): add generic lru class (#2351)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-01-07 21:51:46 +02:00
adiholden
a1d85b7cb2
feat(server): allow running memory commands under script (#2382)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-01-07 16:16:57 +02:00
Borys
d119ee8915
refactor(cluster): remove SYNC cmd and do data transferring during FLOW (#2369)
feat(cluster): remove SYNC cmd and do data transfering during FLOW
2024-01-07 16:10:49 +02:00
adiholden
f37c57c704
fix(server): crash on rename save command on background save (#2375)
* fix(server): crash on rename save command on baground save

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-01-07 12:21:09 +02:00
Shahar Mike
2d46a584a3
refactor(SerializerBase): Move some logic from RdbSerializer to SerializerBase (#2373)
* refactor(SerializerBase): Move some logic from RdbSerializer to SerializerBase

Specifically SendFullSyncCut and WriteJournalEntry

* gh review
2024-01-07 07:48:29 +02:00
Shahar Mike
13c2e672b0
feat(server): Add RestoreSerializer (#2366)
* feat(server): Add `RestoreSerializer`

This utility class serializes `CompactObj`s as `RESTORE` commands, and
has a similar interface (and a common base class) as `RdbSerializer`

* RETURN_ON_ERR

* fixes
2024-01-04 15:03:14 +02:00
Shahar Mike
b15109d4d2
fix(test): Fix flaky test (#2372)
Issue was that in `ServerFamilyTest.SlowLogLen` we set the threshold to
be 0 microseconds and make sure that all commands are logged as slow.
However, in opt, some commands sometimes take 0 microseconds, which
fails the test.

Confirmed via:

```
./server_family_test --gtest_repeat=100 --gtest_filter=ServerFamilyTest.SlowLogLen
```
2024-01-04 11:23:17 +00:00
Roman Gershman
0e72846457
chore: consolidate facade stats under a single struct (#2368)
* chore: consolidate facade stats under a single struct

Remove connection stats from server state and move them under FacadeStats.

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

* chore: fixing comments

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-01-03 08:09:00 +00:00
Roman Gershman
e063180c8d
chore: add memory usage test for skiplist encoding (#2367) 2024-01-03 10:03:39 +02:00
Kostas Kyrimis
aec097701a
chore: add comment for c_rehash in ca_cert_dir flag description (#2365) 2024-01-03 09:48:05 +02:00
Roman Gershman
cb3e366459
feat: introduce user timeout (#2361)
* feat: introduce user timeout

* feat: introduce tcp_user_timeout flag.

See TCP_USER_TIMEOUT flag in tcp(7) man page.
This linux-only setting allows fail faster during the send operation
if for some reason the remote socket is unresponsive and does not send ACKs for
the transmitted segments.

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

* Update src/facade/dragonfly_listener.cc

Co-authored-by: Shahar Mike <chakaz@users.noreply.github.com>
Signed-off-by: Roman Gershman <romange@gmail.com>

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Signed-off-by: Roman Gershman <romange@gmail.com>
Co-authored-by: Shahar Mike <chakaz@users.noreply.github.com>
2024-01-03 08:06:25 +02:00
Yue Li
6f9107291e
test: Adding integration test using Relay benchmark (#2348)
Adding integration test using Relay benchmark
2024-01-02 12:44:22 -08:00
adiholden
8411ce71d1
fix(dash table): bucket count returns the number of buckets (#2359)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-01-02 21:57:52 +02:00
Shahar Mike
4b2dd9e726
refactor(serializer): Move DUMP logic into RdbSerializer (#2363) 2024-01-02 19:05:00 +02:00
Shahar Mike
d9886024d3
refactor(rdb): Expose default compression mode without direct flag (#2360)
* refactor(rdb): Expose default compression mode without direct flag

* fixes
2024-01-02 13:48:50 +00:00
Borys
5b905452b3
fix: unblock transactions only if requirements are correct (#2345)
fixes #2294

bug: we unblock XREADGROUP cmd even if we don't have new values

fix: added check with custom requirements for blocking comands
2024-01-02 14:55:06 +02:00
Borys
03f69ff6c3
feat: add SLOT-MIGRATION-STATUS cmd for source node (#2349)
* feat: add SLOT-MIGRATION-STATUS cmd for source node
implements #2232
add ability using SLOT-MIGRATION-STATUS without args
to print info about all migration processes for the current node
2024-01-02 12:10:06 +02:00
adiholden
c60e4accc6
feat(tiering): add max file size limit (#2344)
* add max file size flag

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-01-02 12:07:34 +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
4c2d37f3c6
chore: add "send" state to client list (#2357)
chore: add send state to client list

This can be done only via a differrent fiber by inspecting SinkReplyBuilder state.
Also, get rid of awkward reply builder statistics and use instead thread local stats for that.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-01-01 17:13:27 +02:00
Shahar Mike
069625f23f
refactor(generic_family): Don't allocate StringSink on the heap (#2356)
refactor(generic_family): Don't allocate serializer on the heap
2024-01-01 14:57:59 +02:00
Shahar Mike
40f2a7190e
feat(getslotsinfo): Add memory usage per slot (#2355)
It's a good thing we waited with this feature until after the recent
refactors. Now it's trivial and safer!

Fixes #1478
2024-01-01 09:15:05 +02:00
Roman Gershman
1fb0a486ac
chore: transaction simplification (#2347)
chore: simplify transaction multi-locking

Also, add the ananlysis routine that determines whether the schewduled transaction is contended with other transaction in a
shard thread.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-12-31 17:02:12 +02:00
Roman Gershman
ddbdf63470
fix: relax the requirement for parsing successfully container limits (#2352)
We parse the container limits for heuristics that deduces memory/cpu capacities automatically.
It's ok if we fail on some less common systems since there are manual overrides that allows specifying these
limits explicitly.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-12-30 13:31:40 +02:00
Shahar Mike
c7093c40e5
fix(SimpleLruCounter): Correctly set bumped node's next (#2346) 2023-12-28 10:26:16 +00:00
Shahar Mike
69f269e808
feat(makefile): Build with full debug symbols and strip in make package (#2343)
Before this PR, using `make` for building releases used `-g1 -gz` to
provide some level of debug symbols (mostly function names in stack
traces).

We want to be able to have binaries with full debug symbols (for
coredumps etc), but not in the public releases.

This PR builds with full debug symbols, but changes `make package` to
strip most debug symbols, while keeping `.debug_line` (and keeping them
compressed as if with `-gz`). This will allow a single build command for
public releases as well as releases with full symbols.
2023-12-27 17:48:29 +02:00
Shahar Mike
20b7c22055
fix(server): Fix reply seconds & better metrics names (#2342) 2023-12-27 17:48:15 +02:00
Roman Gershman
5035d4e1e3
chore: expose the multi length in slowlog (#2339)
1. Fix AnalyzeTxQueue to stop crashing for various transaction types.
2. Pass exec command length to slowlog

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-12-27 16:11:14 +02:00
adiholden
5d67c95797
bug(server): reject replicaof while loading from snapshot (#2338)
fix #2337
The bug:
replicaof was not rejected while loading snapshot
The fix:
replicaof is allowed while server is in loading state to allow replicaof while replication in full sync mode
I now reject replicaof if the server is in loading state and it is master

Another bug fix:
allow cron snapshot if --replicaof flag was set

Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-12-27 13:57:49 +02:00
Vladislav
8c873fd71c
fix: Invalid key lock strings with squashing (#2341)
* fix: clear shard data in squash preparation
2023-12-27 11:48:43 +02:00
Shahar Mike
16a0becea5
feat(server): Add reply count & latency metrics (#2340)
* feat(server): Add reply count & latency metrics

* fixes
2023-12-26 23:02:45 +02:00
Roman Gershman
5b81ccda18
feat: expose transaction types via /metrics (#2336)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-12-26 15:22:14 +02:00
Vladislav
1caa4ee0f1
feat(search): Aggregator, step 1 (#2332)
* feat(search): Aggregator, step 1

* feat: Add basic reducers

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-12-25 15:57:16 +03: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
ce7497071c
feat: introduce 'debug tx' command and periodic overload logs (#2333)
This command shows the current state of transaction queues,
specifically how many armed (ready to run) transactions there,
how loaded these queue are and how many locks there are in each shard.

In addition, if a tx queue becomes too long, we will output warning logs about
the state of the queue, in order to be able to identify
the bottlenecks post-factum.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-12-25 11:48:55 +02:00
Shahar Mike
a360b308c9
refactor(server): Privatize PreUpdate() and PostUpdate() (#2322)
* refactor(server): Privatize `PreUpdate()` and `PostUpdate()`

While at it:
* Make `PreUpdate()` not decrease object size
* Remove redundant leftover call to `PreUpdate()` outside `DbSlice`

* Add pytest

* Test delete leads to 0 counters

* Improve test

* fixes

* comments
2023-12-25 07:49:57 +00:00
Roman Gershman
700a65ece5
chore: refactor VersionMonitor into a separate file (#2326)
* chore: refactor VersionMonitor into a separate file
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-12-24 22:06:57 +02:00
Vladislav
d129674e17
chore(search): Block list (#2307)
chore(search): Block list

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-12-24 17:42:03 +03:00
Roman Gershman
8bd43497f2
feat: expose tx_queue_len metric (#2330)
This metric shows how much the transaction queue of dragonfly is loaded.
Also, output free text, human intended replies as verbatim.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-12-24 11:31:50 +02:00
Roman Gershman
f90317a795
feat: add keyspace_mutations metric (#2329)
* feat: add keyspace_mutations metric

Currently we expose hits/misses for read only commands only (compatible with redis).
`keyyspace_mutations` complement this providing number of key operations for write commands.
It's interesting because now we can learn the number of key_ops vs API ops, where
key_ops = misses + hits + mutations

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

* chore: address fixes

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

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-12-24 10:21:36 +02:00
Roman Gershman
4562fad737
chore: refactor slowlog code, no functionality changes (#2331)
Goal: to improve readability of the code.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-12-23 18:40:03 +02:00
Roman Gershman
bbe3d9303b
feat: introduce transaction statistics in the info output (#2328)
1. How many transactions we processed by type
2. How many transactions we processed by width (number of unique shards).

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-12-23 13:18:49 +02:00