* chore: refactor StringFamily::Set to use CmdArgParser
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* chore: adress comments
---------
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* fix(flushslots): Don't miss updates in `FLUSHSLOTS`
This PR registers for PreUpdate() from inside the `FLUSHSLOTS` fiber so
that any attempt to update a to-be-deleted key will work as expected
(first delete, then apply the change).
This fixes several issues:
* Any attempt to touch bucket B (like insert a key), where another key
in B should be removed, caused us to _not_ remove the latter key
* Commands which use an existing value but not completely override then,
like `APPEND` and `LPUSH` did not treat the key as removed but instead
used the original value
Fixes#2771
* fix flushslots syntax in test
* EXPECT_EQ(key:0, xxxx)
* dbsize
* chore: add SBF data structure
Based on https://gsd.di.uminho.pt/members/cbm/ps/dbloom.pdf
The data-structure itself is a growing list of bloom filters,
where the next filter has exponentially larger capacity with exponentially tighter error bound.
The Exist() goes over all the filters and it's enough that at least one of them returns a positive result.
For Add(), we make ensure that all the existing filters do not have the element, as well as making sure that the last
filter that is being filled does not cross its maximum designated capacity.
---------
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* chore: add bloom filter class
Based on https://github.com/jvirkki/libbloom implementation.
Unlike the original, our implementation uses XXH3 hash function to seed bit index generation.
In addition, it assumes mi_malloc interface for dynamic allocation.
---------
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* chore: preparation for basic http api
The goal is to provide very basic support for simple commands,
fancy stuff like pipelining, blocking commands won't work.
1. Added optional registration for /api handler.
2. Implemented parsing of post body.
3. Added basic formatting routine for the response. It does not cover all the commands but should suffice for
basic usage.
The API is a POST method and the body of the request should contain command arguments formatted as json array.
For example, `'["set", "foo", "bar", "ex", "100"]'`.
The response is a json object with either `result` field holding the response of the command or
`error` field containing the error message sent by the server.
See `test_http` test in tests/dragonfly/connection_test.py for more details.
* chore: cover iouring with enable_direct_fd
---------
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* fix(helm): add issuer group to create the certificate without wait for the previous created issuer
Signed-off-by: Fabiano Arruda Ferreira das Graças <fafg@fafg-mbm1.fritz.box>
* fix(helm): remove condition that can prevent the helm chart be rendered on machines where monitoring.coreos.com is not installed or is not the end target of the helm template command
Signed-off-by: fafg <fabiano.arruda@hotmail.com>
* fix(helm): lint - remove blank line
Signed-off-by: fafg <fabiano.arruda@hotmail.com>
* add(helm): missing service monitor test files
Signed-off-by: fafg <fabiano.arruda@hotmail.com>
* add(helm): add missing cert-manager test files
Signed-off-by: fafg <fabiano.arruda@hotmail.com>
* fix(helm): lint - add missing blank lines
Signed-off-by: fafg <fabiano.arruda@hotmail.com>
* fix(helm): rebase
Signed-off-by: fafg <fabiano.arruda@hotmail.com>
* Revert "fix(helm): rebase"
This reverts commit c4ce16b76e.
* fix(helm): fix service monitor namespace rendering
Signed-off-by: fafg <fabiano.arruda@hotmail.com>
* fix(helm): add missing up to date golden file
Signed-off-by: fafg <fabiano.arruda@hotmail.com>
* fix(helm): merge upstream
Signed-off-by: fafg <fabiano.arruda@hotmail.com>
* update golden files
* also install prom operator dependencies
* also install cert-manager
* skip cert-manager chart
* skip cert-manager value
* remove CI TLS files
* fix formatting
* fix formatting
* fix actions
---------
Signed-off-by: Fabiano Arruda Ferreira das Graças <fafg@fafg-mbm1.fritz.box>
Signed-off-by: fafg <fabiano.arruda@hotmail.com>
Co-authored-by: Tarun Pothulapati <tarun@dragonflydb.io>
Co-authored-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
* feat(replication): Do not auto replicate different master
Until now, replicas would re-connect and re-replicate a master after the
master will restart. This is problematic in case the master loses its
data, which will cause the replica to flush all and lose its data as
well.
This is a breaking change though, in that whoever controls the replica
now has to explicitly issue a `REPLICAOF X Y` in order to re-establish
a connection to a new master. This is true even if the master loaded an
up to date RDB file.
It's not necessary if the replica lost connection to the master and the
master was always alive, and the connection is re-established.
Fixes#2636
* fix test
* fixes
* proxy proxy java java
* better comment
* fix comments
* replica_reconnect_on_master_restart
* proxy.close()
1. More test fixes to support both types
2. Adjust Aggregation functions to work with both types
3. jsonpath_test build from both types and passes for JsonType,
the tests are skipped for flexbuffers
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Also adjust jsonpath_test to be a typed test to allow run the same tests
for both jsoncons and flatbuffers.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
1. Use clib malloc for allocating fiber stacks but reduce the fiber stack size.
clib malloc uses default 4K OS pages when reserving memory from the OS.
The reason for not using mi_malloc, because we use 2MB large OS pages with mimalloc.
However, allocating stacks is one of the cases, when using smaller 4KB memory pages is actually more
RSS efficient because memory pages become hot at better granularity.
2. Add "memory_fiberstack_vms_bytes" metric exposing fiber stack vm usage.
3. Fix macos dependencies & update ci versions.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* feat(json): Deserialize ReJSON format
This PR adds support for Redis-based JSON RDB format deserialization.
Since Redis uses ReJSON as a module, serialization is slightly different
from other types, but overall it's not a big change once we know where
all bits should be.
While this change knows how to _read_ Redis-based JSON keys, it does not
_save_ them in Redis format. That will be in a different PR.
This PR also ignores unknown (non-keys) module data instead of failing the load.
Fixes#2718
* Cleanup
* Add tests
* Skip unsupported modules
* Small refactor
1. Replaces run_barrier as a synchronization point with is_armed + an embedded blocking counter for awaiting running jobs
2. Replaces IsArmedInShard + GetLocalMask + is_armed.exchange chain with a single DisarmInShard() / DisarmInShardWhen
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>