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

1827 commits

Author SHA1 Message Date
Roman Gershman
97bde35a0f
Fix redis->DF replication tests (#2495)
fix: redis_replication_test fails due to long time for df replicas takes to catch up.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-01-29 03:25:58 +02:00
Roman Gershman
d7604c1bd0
chore: remove batch reply statistics (#2490)
1. average batch latency will always be 0, because even in cases we have outliers they will be dominated by
   small CPU only copies that take dozens of ns.
2. Measuring an operation like kBatch, which is solely CPU-based, necessitated the use of a clock. According to the CPU profiler,
   this contributed to approximately 5% of the CPU usage.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-01-29 03:23:38 +02:00
Kostas Kyrimis
754a186f5a
feat(lua): add missing no-op redis.replicate_commands() (#2472)
fixes #2468
add no-op lua function redis.replicate_commands()
2024-01-28 13:05:52 +02:00
Borys
43808da27f
fix(cluster): fix slot filtration to RestoreStreamer (#2477)
* fix(cluster): fix slot filtration to RestoreStreamer

* test: add cluster data migration test
2024-01-28 12:29:54 +02:00
Roman Gershman
d608ec9c62
chore: Introduce LockKey for LockTable (#2463)
This should reduce allocations in a common case (not multi).
In addition, rename Transaction::args_ to kv_args_.

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
Co-authored-by: Vladislav <vlad@dragonflydb.io>
2024-01-28 12:19:15 +02:00
adiholden
9f4c4353b5
fix(server): mget crash on same key get (#2474)
* fix(server): mget crash on same key get

fix: #2465
the bug: on cache mode mget bumps up items. When executing mget with the same key several times i.e mget key key we will invalidate the iterator when we bump up the item in dash table.
the fix: bump up/down items only once by using bumped_items set
This PR also reverts c225113
and updates the bumped stats and bumped_items set if the item was bumped

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-01-28 11:45:35 +02:00
Roman Gershman
3ebb32df3f
chore: lock keys when going through fast-path execution (#2491)
This is needed if we want to allow asynchronous transactional operations during the callback execution.
Also update actions versions.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-01-27 19:02:53 +02:00
Vladislav
675b3889a4
chore(transaction): Launder copied keys in multi transactions (#2478)
* chore(transaction): Launder copied keys in multi transactions

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-01-27 12:24:42 +02:00
Roman Gershman
8a3ccff0bc
chore: fix clang warnings (#2485) 2024-01-26 18:40:02 +03:00
Vladislav
7b6181641c
chore(transaction): Simplify PollExecution() (#2457)
* chore(transaction): Simplify PollExecution()

Remove seqlock_ from transaction. This change is possible because:
- We don't re-use shard_data[0] for multi transactions anymore
- We disarm atomically and poll callbacks are stateless

This makes it safe to call PollExecution() unconditionally that will determine on it's own whether the caller needs to run or is already expired

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-01-26 14:34:17 +03:00
Roman Gershman
ea5955962e
chore: switch json object to pmr allocator (#2483)
* chore: switch json object to pmr allocator

1. Move json object creation code to the shard-thread inside rdb_load
2. Now json_family never references "json" type, always dfly::JsonType
3. Switch JsonType to pmr::json.
4. Make sure we pass the correct memory_resource when creating json object from string.

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

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-01-26 12:47:46 +02:00
Vladislav
a5b9401449
fix: reduce test_pipeline_batching_while_migrating flakiness (#2475)
* fix: reduce test_pipeline_batching_while_migrating flakiness
2024-01-25 17:55:12 +03:00
Kostas Kyrimis
ba972923b3
feat(lua): add no-op redis.log command (#2476)
* add no-op redis.log command
2024-01-25 15:45:47 +02:00
romange
1e982cafe8 chore(helm-chart): update to v1.14.1 2024-01-25 12:22:19 +00:00
Vladislav
08d2fa52e1
fix: fixes for v1.14.0 (#2473)
* fix: fixes for v1.14.0

Stop writing to the replication ring_buffer
Stop allocating in TopKeys
Tighter CHECKs around tx execution.

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-01-25 11:23:14 +00:00
Roman Gershman
f69f2ec0ca
fix: resolves the crash with MGET and duplicate keys (#2471)
Fixes #2465

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-01-25 11:51:47 +02:00
Nick Gottlieb
86704dbf1c
Update README.md to include dragonfly cloud link (#2469)
Update README.md

Signed-off-by: Nick Gottlieb <ngottlieb1@gmail.com>
2024-01-25 09:23:14 +02:00
Shahar Mike
e6f418575b
test(cluster): Enable seeder to work against a Dragonfly cluster (#2462) 2024-01-24 20:02:04 +02:00
Vladislav
aeb2b00ac8
fix(transaction): Improve ACTIVE flags management (#2458)
* fix(transaction): Improve ACTIVE flags management

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-01-23 15:40:11 +03:00
Kostas Kyrimis
517be2005e
refactor: return OpResult in DbSlice::AddOrFind instead of throwing std::bad_alloc (#2427)
* return OpResult in AddOrFind instead of throwing bad_alloc
* small refactor
2024-01-23 14:16:03 +02:00
Roman Gershman
1074bcb30b
feat: allow reading offloaded strings without loading to the store (#2449)
* feat: allow reading offloaded strings without loading to the store

* Add disk stats to IoMgr

---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-01-23 09:27:14 +00:00
Shahar Mike
b777d31a98
feat(server): Add backlog flag for listen() (#2456)
* feat(server): Add `backlog` flag for `listen()`
2024-01-23 08:19:53 +00:00
Borys
a16b940a65
feat(cluster): add tx execution in cluster_shard_migration (#2385)
* feat(cluster): add tx execution in cluster_shard_migration
refactor(replication): move code that is common for cluster and
replica into a separate file, add full-sync-cut cmd
2024-01-22 21:19:39 +02:00
Shahar Mike
7debe3c685
fix(RestoreStreamer): Fix a few glitches (#2452) 2024-01-22 10:37:16 +02:00
Vladislav
07a6dc0712
feat(transaction): Independent out of order execution (#2426)
Previously, transactions would run out of order only when all shards determined that the keys locks were free. With this change, each shard might decide to run out of order independently if the locks are free. COORD_OOO is now deprecated and the OUT_OF_ORDER per-shard flag should is used to indicate it

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2024-01-22 10:38:10 +03:00
Roman Gershman
307bdfdb07
chore: improve benchmark for bpptree and zsl tree (#2450)
* chore: improve benchmark for bpptree and zsl tree
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-01-22 10:33:45 +03:00
romange
fab811252b chore(helm-chart): update to v1.14.0 2024-01-22 07:09:27 +00:00
adiholden
cdbeb2f6c2
fix(tiering): update iterator after await throttle (#2440)
* fix(tiering): update iterator after await throttle

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-01-21 11:01:03 +02:00
Roman Gershman
8f454b2dea
fix: allow lock_on_hashtags with any cluster mode (#2443)
Motivation - after we submitted #2429 some smart-ass clients
prevent users from accessing single-node commands like "SELECT".
This PR fixes it by allowing consistent sharding based on hashtags
even with cluster mode disabled.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-01-19 23:44:24 +02:00
adiholden
a11b2a941a
fix(server): dont allow snapshoting in tiering mode (#2438)
* fix(server): dont allow snapshoting in tiering mode

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-01-18 19:40:35 +02:00
Roman Gershman
9304c04b6b
feat: measure latency of pipelined commands (#2436)
feat: measure the latency of pipelined commands

Unlike with regular latency measurement that measures the execution time + the reply time,
here we measure the overall latency from the point in time when a command was parsed.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-01-18 15:55:24 +00:00
Roman Gershman
af23778655
fix: release pipeline (#2439)
We had a place in tools/packaging/generate_debian_package.sh that relied on the existence of build-opt,
moreover, if it did not exist the script deadlocked.

1. Added more loggings
2. Removed the loop
3. Removed unnecessary dependency in the script on the build-dir name.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-01-18 16:52:19 +02:00
Shahar Mike
5586798e90
fix(server): Use custom journal for multi-key PFMERGE cmd (#2437)
While at it, also fix `PFCOUNT` to say that it's a readonly cmd.

Fixed #2421
2024-01-18 12:30:21 +02:00
Shahar Mike
2f0287429d
fix(replication): Correctly replicate commands even when OOM (#2428)
* fix(replication): Correctly replicate commands even when OOM

Before this change, OOM in shard callbacks could have led to data
inconsistency between the master and the replica. For example, commands
which mutated data on 1 shard but failed on another, like `LMOVE`.

After this change, callbacks that result in an OOM will correctly
replicate their work (none, partial or complete) to replicas.

Note that `MSET` and `MSETNX` required special handling, in that they are
the only commands that can _create_ multiple keys, and so some of them
can fail.

Fixes #2381

* fixes

* test fix

* RecordJournal

* UNDO idiotnessness

* 2 shards

* fix pytest
2024-01-18 12:29:59 +02:00
Shahar Mike
b66db852f9
fix: Invalid memory access (#2435)
The (subtle) bug is that the previous code uses an `initializer_list` c'tor, which copies the
`string_view` locally. Then it keeps that reference to the `string_view`,
but it goes out of scope in the next line
2024-01-17 23:23:44 +02:00
Yue Li
d1db48d9d4
feat(server): Tracking memory usage for client tracking table (#2431)
Tracking memory usage for client tracking table using C++ memory resource and polymorphic allocator.
2024-01-17 13:20:23 -08:00
Roman Gershman
e06b736c02
chore: add both df tree impelementations to memory usage test (#2430)
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-01-17 17:55:10 +02:00
Vladislav
bf89c7eac2
chore(transaction): Clean up scheduling code (#2422)
* chore(transction): Clean scheduling code
2024-01-17 17:33:48 +03:00
adiholden
9f3b118b87
server(tiering): load data on read (#2415)
* server(tiering): load data on read

Signed-off-by: adi_holden <adi@dragonflydb.io>
2024-01-17 16:13:56 +02:00
Roman Gershman
8eda8226b2
fix: release.sh (#2432) 2024-01-17 12:51:31 +00:00
Shahar Mike
b7b97452c4
fix(info): Reply with correct redis_mode in `INFO (#2429)
* fix(info): Reply with correct `redis_mode` in `INFO

Fixes #2400

* `HELLO` `HELLO` `HELLO`!

* Fix test
2024-01-17 11:10:24 +02:00
Kostas Kyrimis
3031e7a3ee
fix: non reset fields in command config resetstat (#2425) 2024-01-17 08:21:39 +02: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
Vladislav
1fb3c74933
fix(rdb): Remove transaction from pre/post load search index rebuild (#2419) 2024-01-16 10:08:16 +03:00
Vladislav
de817098a7
feat(transaction): Single hop blocking, callback flags (#2393)
* feat(transaction): Single hop blocking, callback flags
2024-01-15 21:13:22 +03:00
Roman Gershman
b6f4370ae7
feat: allow throttling tiered writes (#2414)
* feat: allow throttling tiered writes

The throttling is controlled by tiered_storage_throttle_us flag
and can be disabled by passing `--tiered_storage_throttle_us=0`.
This introduces a soft back-pressure during writes.

On my machine `debug POPULATE 10000000 key 1000 RAND` with tiered_storage_throttle_us=0
offloads 12% of all the entries, but with tiered_storage_throttle_us=1 it offloads
almost 100% by prolonging the operation from 0.96s to 1.72s.
---------

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2024-01-15 13:21:23 +02:00
Shahar Mike
f4c1e33d48
cleanup: Remove unused PerformDeletion() overloads (#2418) 2024-01-15 11:15:35 +00:00
Vladislav
078db5caae
fix(tx): guard parallel writes to local result (#2417) 2024-01-15 13:51:30 +03:00
Kostas Kyrimis
39e7e5ad87
fix: missing error reply to client after AddOrFind throw std::bad_alloc (#2411)
* Handle properly and reply on execution paths that throw std::bad_alloc within AddOrFind
2024-01-15 10:13:10 +02:00
Shahar Mike
13718699d8
feat(server): Implement CLIENT KILL (#2404)
* feat(server): Implement `CLIENT KILL`

Currently, it supports the following syntax:

* `CLIENT KILL <addr>:<port>`
* `CLIENT KILL ID <id>`
* `CLIENT KILL ADDR <addr>:<port>`
* `CLIENT KILL LADDR <addr>:<port>`

It will not allow killing an admin-connection from a non-admin port.

There are a few parameters of `CLIENT KILL` that Redis supports but this
PR does not yet add. Let's add them as needed.

Fixes #1614

* Add tests

* fixes
2024-01-15 09:49:23 +02:00