* chore: optimize info command
Info command has a large latency when returning all the sections.
But often a single section is required. Specifically,
SERVER and REPLICATION sections are often fetched by clients
or management components.
This PR:
1. Removes any hops for "INFO SERVER" command.
2. Removes some redundant stats.
3. Prints latency stats around GetMetrics command if it took to much.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* Update src/server/server_family.cc
Co-authored-by: Shahar Mike <chakaz@users.noreply.github.com>
Signed-off-by: Roman Gershman <romange@gmail.com>
* chore: remove GetMetrics dependency from the REPLICATION section
Also, address comments
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* fix: clang build
---------
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>
**The problem:**
When in cluster mode, `MOVED` replies (which are arguably not even errors) are aggregated per slot-id + remote host, and displayed in `# Errorstats` as such. For example, in a server that does _not_ own 8k slots, we will aggregate 8k different errors, and their counts (in memory).
This slows down all `INFO` replies, takes a lot of memory, and also makes `INFO` replies very long.
**The fix:**
Use `type` `MOVED` for moved replies, making them all the same under `# Errorstats`
Fixes#4118
* chore: simplify BumpUps deduplication
This pr #2474 introduced iterator protection by
tracking which keys where bumped up during the transaction operation.
This was done by managing keys view set. However, this can be simplified
using fingerprints. Also, fingerprints do not require that the original keys exist.
In addition, this #3241 PR introduces FetchedItemsRestorer that tracks bumped set and
saves it to protect against fiber context switch. My claim is that it's redundant.
Since we only keep the auto-laundering iterators, when a fiber preempts these iterators recognize it
(see IteratorT::LaunderIfNeeded) and refresh themselves anyway.
To summarize: fetched_items_ protect us from iterator invalidation during atomic scenarios,
and auto-laundering protects us from everything else, so fetched_items_ can be cleared in that case.
---------
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
The regression was caused by #3947 and it causes crashes in bullmq.
It has not been found till now because python client sends commands in uppercase.
Fixes#4113
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Co-authored-by: Kostas Kyrimis <kostas@dragonflydb.io>
chore: implement Erase with a range
Also migrate more unit tests from valkey repo.
Finally, fix OpTrim
All tests `list_family_test --list_experimental_v2` pass.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
chore: implement OpTrim with QList
* fix(search_family): Process wrong field types in indexes for the FT.SEARCH and FT.AGGREGATE commands
fixes #3986
---------
Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>
* chore: change Namespaces to be a global pointer
Before the namespaces object was defined globally.
However it has non-trivial d'tor that is being called after main exits.
It's quite dangerous to have global non-POD objects being defined globally.
For example, if we used LOG(INFO) inside the Clear function , that would crash dragonfly on exit.
Ths PR changes it to be a global pointer.
---------
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* chore: implement QList::Erase functionality
Also add a parametrized test covering fill/compress options.
Fix a compression bug introduced when copying the code.
Introduce move c'tor/operator.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* chore: implement QList::Replace functionality
Also add a parametrized test covering fill/compress options.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
---------
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
* chore: implement QList::Insert function
Also add a basic test for Insertion.
Prepare the skeleton for Replace functionality.
---------
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Most of our CO:: categories became meaningless with the introduction of acl. For example, CO::FAST literally doesn't mean anything, it's never read or used.
* add implicit categories
---------
Signed-off-by: Vladislav Oleshko <vlad@dragonflydb.io>
This class will consolidate list functionality across multiple layers, and eventually replace the original quicklist code.
Right now we added the skeleton files and defined most of the interface.
The implementation is not done yet.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
1. Eliminate redundant states
2. Eliminate redundant member variables
Added some comments. No functional changes.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
ReallocIfNeeded deleted and reinserted the same key in the BPTree stored in SortedMap. This is not really needed since the key is actually the same and we can just update the pointer within BPTree instead of doing the deletion + insertion chore.
---------
Signed-off-by: kostas <kostas@dragonflydb.io>
Not everything is supported but manual load save is supported.
1. Run dragonfly with `--dir gs://bucket/path`
2. In redis-cli:
a. SET foo bar
b. SAVE DF gsdump
c. DFLY LOAD gs://bucket/path/gsdump-summary.dfs
Signed-off-by: Roman Gershman <roman@dragonflydb.io>