* feat(pytest): More types for seeder
Add more types to the seeder and refactor replication test
---------
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
Example usage:
```bash
# Create a 2-node cluster
./cluster_mgr.py --action=create --replicas_per_master=1 --num_master=2
# Move (no migration) all slots to first node
./cluster_mgr.py --action=move --target_port=7001 --slot_start=8192 --slot_end=16383
# Fill data - like run memtier
# Migrate all slots to 2nd node. One could measure how long this step takes.
./cluster_mgr.py --action=migrate --target_port=7002 --slot_start=0 --slot_end=16383
```
The bug: crash when starting replica while saving
The problem: accessing the wrong allocator on snapshot class destruction as it was destructed not in the thread of the shard
The fix: call snapshot destructor when we finish snapshot on the correct thread
Signed-off-by: adi_holden <adi@dragonflydb.io>
Specifically, allows expressions in the form of
`max($.objs[*].score`, i.e. where a function aggregates 0 or more values
produced by the path expression. The final value is passed to a PathCallback.
In case no matches are found, json null value is passed. In any case, the callback
is called exactly once for such expressions.
In addition, fixed a parser bug that does not allow fields after the bracketing expression.
Finally, introduced an utility function for easier parsing of json::Path.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* chore(transaction): Untie scheduling from multi status
Idea: We decide whether we have to schedule not based on our multi status (atomic multi), but solely based on the fact if COORD_SCHED is set
Goal: Being able to use ScheduleSingleHop()/Schedule() for multi transactions, and thus later allow single hop multi transactions
---------
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
Fix linker dependencies - now dfly_core depends on jsonpath.
jsonpath does not depend on CompactObject anymore.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
No functional changes are made.
This change is needed to allow traversal functionality that will mutate json object during the traversal.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* feat: wire json::Path into the server
The feature is disabled under a flag and it covers read operations for now.
---------
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* fix: do not migrate during connection close
Fixes#2569
Before the change we had a corner case where Dragonfly would call
OnPreMigrateThread but would not call CancelOnErrorCb because OnBreakCb has already been called
(it resets break_cb_engaged_)
On the other hand in OnPostMigrateThread we called RegisterOnErrorCb if breaker_cb_ which resulted in double registration.
This change simplifies the logic by removing break_cb_engaged_ flag since CancelOnErrorCb is safe to call if nothing is registered.
Moreover, we now skip Migrate flow if a socket is being closed.
---------
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* chore: provide plumbing for jsonpath error propagation
Also update re/flex library to the latest version.
Finally, introduce very basic parser test.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* feat: construct Path object
Parse jsonpath and partially fill it with path segments.
---------
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* test(memory): Test memory accounting for all types
* slightly faster
* WIP
* working
* Document
* Update test to use DEBUG POPULATE
* Nothing much
* Working
* fix
* yaml
* explicit capture
* fix ci?
* stub tx
* chore(transaction): Simplify armed state
Remove atomic is_armed variable and turn it into a regular local state flag. This is now possible because we have clearly defined phases with the phased barrier and baton barrier for blocking commands
---------
Signed-off-by: Vladislav <vlad@dragonflydb.io>
InterpreterManager::Reset creates now a new storage for interpreters,
and waits for the old ones to be returned.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>