Commit graph

992 commits

Author SHA1 Message Date
Vladislav
3a6b98f201
fix(pytest): Disable script test (#972) 2023-03-21 16:53:47 +03:00
ashotland
85a1bf8494
fix(tests):Comment out ZPOPMIN Action Again (#971)
fix(tests):Comment out SPOPMIN Action Again 

Until #949 is fixed

Signed-off-by: ashotland <ari@dragonflydb.io>
2023-03-21 15:26:46 +02:00
Vladislav
6d3a191a5f
tests(replication): Test script replication (#960)
Script replication test
2023-03-20 22:57:52 +03:00
romange
23e055e675 chore(helm-chart): update to v1.0.0 2023-03-20 08:52:56 +00:00
Vladislav
03fb21a280
feat(server): Replace channel slice with store (#938)
* feat(server): Replace channel slice with store

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

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-03-20 10:46:08 +02:00
Tarun Pothulapati
34aec80e5a
fix(docker): Use the right shebang in healthcheck.sh (#963)
Alpine images don't have bash installed by default, so we need to use
`/bin/sh` instead. This follows the *same existing convention that
we follow in the `entrypoint.sh` script*.

Both ubuntu and alpine images have been tested (i.e healthchecks to
pass) to work with this change.
2023-03-20 08:59:00 +02:00
ashotland
d2d70289ff
fix(tests): Revive commented out actions (#962)
* fix(tests): Revive commented out actions
---------

Signed-off-by: ashotland <ari@dragonflydb.io>
2023-03-19 22:30:50 +02:00
Vladislav
97c1712a02
fix(tests): Fix interpreter test (#961)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-03-19 22:29:01 +02:00
Vladislav
696b85a259
fix(server): fix Interpreter::AddFunction (#959)
fix(server): fix interpreter::AddFunction

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-03-19 16:42:15 +02:00
Vladislav
623c5a85e3
fix(server): Fix transaction index + shard_data multi re-use (#958) 2023-03-19 12:18:02 +03:00
Vladislav
9f0e269a12
feat(server): Specify script flags with shebang (#944)
* feat(server): Specify script flags with shebang

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

* fix(server): Ignore erros with no-writes flag

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

---------

Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-03-19 08:10:24 +02:00
chakaz
68cb4d006a Use atomic_bool for detecting if TopKeys is on.
Signed-off-by: chakaz <chakaz@chakaz>
2023-03-18 15:27:39 +02:00
chakaz
5b4af6dbd0 Enable TopKeys by default.
This is a better API as it's less confusing. This feature is still disabled by default via the controlling flag.

Signed-off-by: chakaz <chakaz@chakaz>
2023-03-18 15:27:39 +02:00
chakaz
96b44750fe Fix missing dependency.
Signed-off-by: chakaz <chakaz@chakaz>
2023-03-18 15:27:39 +02:00
chakaz
9dfa687034 Apply clang-format
Signed-off-by: chakaz <chakaz@chakaz>
2023-03-18 15:27:39 +02:00
chakaz
e9f5039665 feat(server): Introduce and use TopKeys class.
TopKeys uses a custom implementation of HeavyKeeper to track top (hot)
keys usage for debugging purposes.
This commit also integrates TopKeys (default off) into DbTable and counts
usage of (present) key lookups.

Signed-off-by: chakaz <chakaz@chakaz>
2023-03-18 15:27:39 +02:00
Roman Gershman
a9d6e0b58d feat: Support sse2 builds.
Reduce reliance on modern vectorized architectures pending proper configuration flags.
Should fix the daily build pipeline.
Fixes #732.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-18 15:21:12 +02:00
chakaz
9add31e20f Get DragonDB to compile with clang.
While at it, fix some compile warnings, 2 of them are actual bugs
(missing virtual d'tor).

Signed-off-by: chakaz <chakaz@chakaz>
2023-03-18 11:02:37 +02:00
Roman Gershman
bb78c6eae3
chore: Update license date 2023-03-17 22:24:05 +02:00
Roman Gershman
4870d8150c fix: Fix deadlock in the transaction code.
The deadlock happenned during the brpop flow where we access
shard_data.local_data from both coordinator and shard threads.
Originally, shard_data.local_data was not designed for concurrent access,
and I used ARMED bit to deduplicate callback runs for each shard.
The problem is that within BRPOP flow, the
ExecuteAsync would apply "=| ARMED" and in parallel NotifySuspended would apply
" |= AWAKED" in the shard thread, and both R/M/W operations would corrupt each other.

Therefore, I separated now completely shard-local local_data mask and is_armed boolean.
Moreover, since now we use atomics for is_armed, I increased PerShardData size to 64 bytes
to avoid false cache sharding betweenn PerShardData objects.

Fixes #945

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-17 20:36:11 +02:00
Roman Gershman
f4081f3979 fix: improve consistency around brpop flow
1. Added a test that was breaking earlier.
2. Made sure that multiple waked brpop transaction would not
   snatch items from one another.
3. Fixed watched-queues clean-up logic inside blocking_controller that caused deadlocks.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-17 11:49:23 +02:00
Roman Gershman
c96f637f73 chore: some pytests and logging improvements
1. pytest extensions and fixes - allows running them
   with the existing local server by providing its port (--existing <port>).
2. Extend "DEBUG WATCHED" command to provide more information about watched state.
3. Improve debug/vlog printings around the code.

This noisy PR is a preparation before BRPOP fix that will follow later.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-17 10:52:20 +02:00
Pascal S. de Kloe
f9ec60ee5f integration test docker image with Go client 2023-03-17 10:09:42 +02:00
Tarun Pothulapati
94b8951f5e fix(ci): Use correct x86-64 with builds
This commits fixes the flag to use the right format
for `x86-64`
2023-03-16 08:52:48 +02:00
adi_holden
dd03ce0cf0 -sfix(rdb_load): replica load expired keys 2023-03-15 13:12:39 +02:00
adiholden
bafad66fc3
fix(replication): redis replication flush all before full sync (#946)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-03-15 09:45:04 +02:00
Tarun Pothulapati
999caa1e4f feat(ci): Add daily builds BFS verification
This commit adds a scheduled job that runs 8 AM Israel time every day,
with common build configuration flags so that we can be sure
that building from source for known configurations is possible.
2023-03-14 23:17:08 +02:00
ashotland
eb962bb5a1
feat(server): hello and info sidekiq compatibility (#941)
Signed-off-by: ashotland <ari@dragonflydb.io>
2023-03-14 23:11:53 +02:00
Roman Gershman
66b4fbd14e fix: correctly set batching mode during pubsub
Previously we set batch mode when dispatch queue is not empty
but dispatch queue could contain other async messages related to pubsub or monitor.
Now we enable batching only if there are more pipeline commands in the queue.

In addition, fix the issue of unlimited aggregation of batching buffer.

Fixes #935.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-14 13:01:48 +02:00
adiholden
97e38aebd2
bug(redis replication): fix multi transaction replication stable state (#934)
Signed-off-by: adi_holden <adi@dragonflydb.io>
2023-03-13 15:14:58 +02:00
adiholden
8e528f1fbb
fix(redis_replicaiton_test): fix compare set types (#929)
* fix(redis_replicaiton_test): fix compare set types

Signed-off-by: ashotland <ari@dragonflydb.io>
Co-authored-by: ashotland <ari@dragonflydb.io>
2023-03-13 13:37:58 +02:00
Roman Gershman
a8c1e5cd4a feat: increase expiry period to 8 years.
Related to #923.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-13 10:19:11 +02:00
Roman Gershman
bac9180602 chore: change thread_local to __thread when possible.
This should reduce the access cost to thread_local objects.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-12 21:57:56 +02:00
Vladislav
149b1fa913
feat(server): Pragmas from scripts (#927)
Parse script param pragmas from script source
2023-03-12 11:05:15 +03:00
ashotland
9c2363584a Delete api_status.md
Update references to docs site command reference.

Signed-off-by: ashotland <ari@dragonflydb.io>
2023-03-12 08:16:28 +02:00
Vahagn Aharonian
1371ce9270 feat(workflow): Add Vercel Docs Hook to release workflow 2023-03-12 08:15:57 +02:00
Roman Gershman
b88fc329a9 fix: serialize subscribe message together with publish message
Fixes #924

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-12 08:15:31 +02:00
Roman Gershman
2ec3d48534 fix: data race during Publish in PubSub
The issue happens when SendMsgVecAsync is called with PubMessage that has
string_view objects referencing objects in stack. We replace string_view
with either string or shared_ptr<string>

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-12 08:15:31 +02:00
Roman Gershman
7975848c36 chore: Expose a corruption when connection writes interleaving messages
The problem happens when a publisher sends a message and a new subscriber registers.
In that case it sends "subscribe" response and the publish messages and those
interleave sometimes.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-12 08:15:31 +02:00
ashotland
85f0f3cbb0
Skip version check if $DFLY_DEV_ENV is set (#928)
Signed-off-by: ashotland <ari@dragonflydb.io>
2023-03-12 00:08:35 +02:00
Chaka
011c086e10
feat(server): Implement BITPOS. (#907)
* feat(server): Implement BITPOS.

Fixes #835.

---------

Signed-off-by: chakaz <chakaz@chakaz>
Co-authored-by: chakaz <chakaz@chakaz>
2023-03-11 22:50:56 +02:00
Tarun Pothulapati
5c57e4efe2
chore(helm): Make release pipeline to update golden files (#916)
Golden files need to be updated as version is updated in the
`Chart.yaml` file. This commit adds the step to update the golden
files in the release pipeline.

To make that possible, The following additional changes are also
required:
- `Go.Work`: This adds support multi-module projects as we will
   have the tests along with the operator in sub-folders. This
   is required to run go cmds from the root directory. (like
   running tests in this case).
- `.helmignore`: This updates the Helm chart to ignore the `/ci`
    folder during helm packaging as those are not required for
    users of the chart.
2023-03-08 23:35:47 +05:30
Vladislav
a37ccbfb28
fix(core): Auto cast doubles to ints in lua scripts (#922)
fix(core): Auto convert double to integers in lua scripts
2023-03-08 19:51:01 +03:00
Roman Gershman
b7abe269f1
fix: send a single RDB_OPCODE_FULLSYNC_END from a snapshot (#920)
Fixes #917 by appending a blob of 8 bytes during serialization and consuming
it during the parsing phase.

Signed-off-by: Roman Gershman <roman@dragonflydb.io>
2023-03-08 13:25:12 +02:00
ashotland
02770fdcd1
fix(tests):Some test cases for redis replication (#918)
* Some test cases for redis replication

Most of them skipped / commented-out to serve as repro without failing
on CI.

---------

Signed-off-by: ashotland <ari@dragonflydb.io>
2023-03-08 10:22:58 +02:00
Vladislav
64e10f083e
fix(server): Change WaitForCallbacks mem order (#914)
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
2023-03-06 16:51:48 +02:00
Tarun Pothulapati
1fc7ef5eaa
chore(helm): update golden files to latest version (#915)
As Version is encoded into the rendered Helm manifests,
They need to be updated with each release so that these
files are in sync with the latest release version.
2023-03-06 19:53:12 +05:30
romange
6e743d43ba chore(helm-chart): update to v0.17.0 2023-03-06 11:48:53 +00:00
Vladislav
7cb2232edc
fix(pytest): Add master restart delay (#909)
- Add restart delay to master in crashing master test
- Add process check after force shutdown
- Increase time limit to 45 min
2023-03-06 00:16:57 +03:00
talbii
0196589786
fix: logging in sentinel_test (#869)
Signed-off-by: talbii <ido@dragonflydb.io>
2023-03-05 16:15:13 +02:00