fix: do not check-fail OpRestore
In some rare cases we reach inconsistent state inside OpRestore where a key already exists, though it should not.
In that case log the error instead of crashing the server. In addition, we update the existing entry to the latest restored value.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
fix(search_family): fix(search_family): Fix crash when no SEPARATOR is specified in the FT.CREATE command
Signed-off-by: Stepan Bagritsevich <stefan@dragonflydb.io>
**The Issue**
We do not serialize lists in PLAIN format well today. We're working on
getting it right, but existing wire format simply doesn't work.
**The (temporary) fix**
This PR attempts to load lists as usual, but upon failure it reverts to
loading a plain list format. This is not a perfect solution, and in some
extreme edge cases it could fail. But.. it's temporary.
Dragonfly responds to ascii based requests to tls port with:
`-ERR Bad TLS header, double check if you enabled TLS for your client.`
Therefore, it is possible to test now both tls and non-tls ports with a plain-text PING.
Fixes#4171
Also, blacklist the bloom-filter test that Dragonfly does not support yet.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
In case of duplicate mget keys, skips fetching the same key twice.
The optimization is straighforward - we just copy the response for the original key,
since the response is a shallow object, we potentially save lots of memory with this
deduplication.
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Update dragonfly.logrotate
If multiple logs are being rotated and one of them fails (due to exit 1), the other logs that follow won't be rotated either, unless logrotate is run again.
If you want to prevent the rotation of a specific log file and not affect the rest of the logs, you'll want to handle the condition properly to ensure that logrotate doesn't abort due to the failure of the prerotate script.
To prevent the rotation of a specific log file without causing issues for other logs, you can use exit 0 to prevent rotation cleanly or design your prerotate script to handle conditions carefully.
Signed-off-by: s13k <s13k@pm.me>
* fix: Huge entries fail to load outside RDB / replication
We have an internal utility tool that we use to deserialize values in
some use cases:
* `RESTORE`
* Cluster slot migration
* `RENAME`, if the source and target shards are different
We [recently](https://github.com/dragonflydb/dragonfly/issues/3760)
changed this area of the code, which caused this regression as it only
handled RDB / replication streams.
Fixes#4143
* 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>
Signed-off-by: Roman Gershman <roman@dragonflydb.io>
**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
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>
* 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: 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>