Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(zset): fix random in ZRANDMEMBER command #2994

Merged
merged 1 commit into from
May 6, 2024

Conversation

BagritsevichStepan
Copy link
Contributor

@BagritsevichStepan BagritsevichStepan commented May 1, 2024

Fixes #2850

The implementation of the ZRANDMEMBER command has two cases:

  1. In the first case, the command is executed in O(n * log(m)), where n is the number of random elements, m is the size of the sorted set. In this case, n indexes are generated using the Robert Floyd's sampling algorithm and then obtained from the set.
  2. In the second case (if n * log(m) is greater than m), the command is executed in O(m). In this case, the algorithm iterates through the entire sorted set

More about the Robert Floyd's sampling algorithm:

@romange
Copy link
Collaborator

romange commented May 1, 2024

Hi @BagritsevichStepan - thank you very much for this PR. I understand that you are aware of the tradeoffs - you specified them in the PR description. You decided to implement a high quality random selection, to preserve the uniformity properties of the algorithm but have more O(n logM) runtime complexity and O(n) space complexity.

Can you explain why do you think a naive " Simple random sampling with replacement" (SRSWR) algorithm won't work here?

@BagritsevichStepan BagritsevichStepan force-pushed the zrandmember_fix branch 2 times, most recently from 8becf94 to 1741f15 Compare May 2, 2024 14:57
@BagritsevichStepan
Copy link
Contributor Author

BagritsevichStepan commented May 2, 2024

Hi @BagritsevichStepan - thank you very much for this PR. I understand that you are aware of the tradeoffs - you specified them in the PR description. You decided to implement a high quality random selection, to preserve the uniformity properties of the algorithm but have more O(n logM) runtime complexity and O(n) space complexity.

Can you explain why do you think a naive " Simple random sampling with replacement" (SRSWR) algorithm won't work here?

Hi @romange,
Here's how random indexes generation works:
1. If count < 0 (repeating elements are possible), then the naive SRSWR algorithm you mentioned is used. But I noticed that in this case I am creating an additional array of n elements (n is the number of members returned). I fixed this in the last commit, so no more additional memory is used.
2. If count >= 0 (no repeated elements are returned), then the Robert Floyd's sampling algorithm is used. In this case, I generate n random indexes in O(n). The space complexity is O(n).

Then the algorithm finds the elements from the sorted set by the generated indexes. There are also two options here:

  1. In the first case, the algorithm gets the elements from the sorted set by making a query for each generated index. The time complexity of each query is O(log m) (m is the number of elements in the sorted set). In total O(n * log m).
  2. In the second case, the algorithm gets all the elements from the sorted set as an array. And then it gets each element by index from that array. In this case, time complexity is O(m).

If I'm not mistaken, the current implementation of HRANDFIELD command uses only the second case and thus has O(m) time complexity. However, in some cases O(n * log(m)) can be faster.

Note: The HRANDFIELD is similar to ZRANDMEMBER, so I used its implementation as an example.

dranikpg
dranikpg previously approved these changes May 3, 2024
Copy link
Contributor

@dranikpg dranikpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 157 to 216
// Test WITHSCORES
using ZSetEntry = std::pair<std::string, std::string>;
std::set<ZSetEntry> expected_entries_with_scores{{"a", "1"}, {"b", "2"}, {"c", "3"}};

auto parse_response_with_scores = [](const auto& resp) {
auto vec = resp.GetVec();

std::vector<ZSetEntry> entries;
for (std::size_t i = 1; i < vec.size(); i += 2) {
entries.emplace_back(vec[i - 1].GetString(), vec[i].GetString());
}
return entries;
};

resp = Run({"ZRandMember", "x", "1", "WITHSCORES"});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small nit:

MATCHER_P(AreScoredArrayMatcher, array, "") {
  RespExpr arg_expr = arg;
  // check all (p for p in `args` is in array) 
}

auto AreScoredArray(std::initializer_list<pair<string,string>> l) {
  return AreScoredArrayMatcher(l);
}

would be a more gtest'y way of doing things 😅

Comment on lines 269 to 270
if (!IndexWasPicked(random_index)) {
picked_indexes_.insert(random_index);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: there is emplace()

src/server/zset_family.cc Show resolved Hide resolved
Comment on lines 1783 to 1789
auto generator = [count, picks_count, size]() -> std::unique_ptr<PicksGenerator> {
if (count >= 0) {
return std::make_unique<UniquePicksGenerator>(picks_count, size);
} else {
return std::make_unique<NonUniquePicksGenerator>(size);
}
}();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: cool trick but maybe less readable than just
unique ? static_cast<unique_ptr<A>>(make_unique<B>()) : make_unique<C>();
or an if with the generator delcared before

virtual ~PicksGenerator() = default;
};

class NonUniquePicksGenerator : public PicksGenerator {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This classes are generic generators
I think that total_size_ can be renamed to max_range type uint32_t
also return value from Generate can be changed to uint32_t

}

RandomPick Generate() override {
const std::size_t max_index = current_random_limit_++;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a dcheck that generate is called not more than picks_count

"3",
"c",
});
auto resp = Run({"ZAdd", "x", "1", "a", "2", "b", "3", "c"});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good coverage of unit tests
good work here!

@BagritsevichStepan
Copy link
Contributor Author

BagritsevichStepan commented May 5, 2024

I fixed the code review comments. @adiholden @dranikpg please take a second look, thank you!

@adiholden
Copy link
Collaborator

@BagritsevichStepan the code looks good
but I think there is a problem with a rebase you did as I see changes in this PR from another PR, please check this

fixes dragonflydb#2850

Signed-off-by: Stepan Bagritsevich <sbagritsevich@quantumbrains.com>
@adiholden adiholden merged commit 7d522fd into dragonflydb:main May 6, 2024
7 checks passed
kireque pushed a commit to kireque/home-ops that referenced this pull request May 10, 2024
…nfly ( v1.17.1 → v1.18.0 ) (#539)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[docker.dragonflydb.io/dragonflydb/dragonfly](https://togithub.com/dragonflydb/dragonfly)
| minor | `v1.17.1` -> `v1.18.0` |

---

### Release Notes

<details>
<summary>dragonflydb/dragonfly
(docker.dragonflydb.io/dragonflydb/dragonfly)</summary>

###
[`v1.18.0`](https://togithub.com/dragonflydb/dragonfly/releases/tag/v1.18.0)

[Compare
Source](https://togithub.com/dragonflydb/dragonfly/compare/v1.17.1...v1.18.0)

##### Dragonfly v1.18.0

Some prominent changes include:

- ACL improvements:
[#&#8203;2945](https://togithub.com/dragonflydb/dragonfly/issues/2945)
[#&#8203;2943](https://togithub.com/dragonflydb/dragonfly/issues/2943)
[#&#8203;2920](https://togithub.com/dragonflydb/dragonfly/issues/2920)
[#&#8203;2982](https://togithub.com/dragonflydb/dragonfly/issues/2982)
[#&#8203;2995](https://togithub.com/dragonflydb/dragonfly/issues/2995)
- Implementation of json.merge
[#&#8203;2960](https://togithub.com/dragonflydb/dragonfly/issues/2960)
-   Replication - memory improvements
- Very much alpha support for data tiering. Try it out with
`--tiered_prefix=/pathto/ssd/base` and see how your memory usage goes
down (STRING type only). Do not use it in prod! 😸

##### What's Changed

- feat: retry ACK if the configs are different
[#&#8203;2833](https://togithub.com/dragonflydb/dragonfly/issues/2833)
by [@&#8203;BorysTheDev](https://togithub.com/BorysTheDev) in
[dragonflydb/dragonfly#2906
- chore(tiering): Update Get, Set, Del by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2897
- chore: preparation step for lock fingerprints by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2899
- fix(transaction): Use FinishHop in schedule by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2911
- chore(tiering): Fix MacOs build by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2913
- feat(cluster): Migration cancellation support by
[@&#8203;chakaz](https://togithub.com/chakaz) in
[dragonflydb/dragonfly#2869
- feat: process migration data after FIN opcode
[#&#8203;2864](https://togithub.com/dragonflydb/dragonfly/issues/2864)
by [@&#8203;BorysTheDev](https://togithub.com/BorysTheDev) in
[dragonflydb/dragonfly#2918
- chore(string_family): Refactor SetCmd by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2919
- fix: Improve reply latency of HELLO by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2925
- chore: improve reply latency of SendScoredArray by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2929
- Namespace support in prometheus rule by
[@&#8203;Pothulapati](https://togithub.com/Pothulapati) in
[dragonflydb/dragonfly#2931
- fix: socket closed when RegisterOnErrorCb is called in HandleRequests
by [@&#8203;kostasrim](https://togithub.com/kostasrim) in
[dragonflydb/dragonfly#2932
- chore: bring more clarity when replayer fails by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2933
- Slot migration cancel crash fix by
[@&#8203;BorysTheDev](https://togithub.com/BorysTheDev) in
[dragonflydb/dragonfly#2934
- feat: add ability reaply config with migration
[#&#8203;2924](https://togithub.com/dragonflydb/dragonfly/issues/2924)
by [@&#8203;BorysTheDev](https://togithub.com/BorysTheDev) in
[dragonflydb/dragonfly#2926
- fix(test): Unflake fuzzy cluster migration test by
[@&#8203;chakaz](https://togithub.com/chakaz) in
[dragonflydb/dragonfly#2927
- chore: Remove Schedule() call by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2938
- chore: get rid of lock keys by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2894
- fix: introduce info_replication_valkey_compatible flag by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2936
- feat(metrics): adding max_clients to metrics and info output
([#&#8203;2912](https://togithub.com/dragonflydb/dragonfly/issues/2912))
by [@&#8203;racamirko](https://togithub.com/racamirko) in
[dragonflydb/dragonfly#2940
- chore: adjust transaction code to keystep/3 commands by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2941
- feat(tiering): Get, GetSet, Set test by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2921
- chore(acl): adjust some ACL command responses by
[@&#8203;Niennienzz](https://togithub.com/Niennienzz) in
[dragonflydb/dragonfly#2943
- chore: Pull helio with new future by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2944
- refactor: add cluster namespace by
[@&#8203;BorysTheDev](https://togithub.com/BorysTheDev) in
[dragonflydb/dragonfly#2948
- chore: Introduce ShardArgs as a distinct type by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2952
- chore: Log db_index in traffic logger by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2951
- fixes for v1.18.0 by
[@&#8203;adiholden](https://togithub.com/adiholden) in
[dragonflydb/dragonfly#2956
- feat(tiering): Support append (and modifications in general) by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2949
- feat: extended bracket index in jsonpath by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2954
- chore: Remove TieringV1 by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2962
- fix(pytests): replace proc.wait() with proc.communicate() to avoid
deadlocks by [@&#8203;kostasrim](https://togithub.com/kostasrim) in
[dragonflydb/dragonfly#2964
- feat(tiering): Registered buffers by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2967
- feat: add slot migration error processing by
[@&#8203;BorysTheDev](https://togithub.com/BorysTheDev) in
[dragonflydb/dragonfly#2957
- chore(acl): allow multiple users in acl deluser by
[@&#8203;kostasrim](https://togithub.com/kostasrim) in
[dragonflydb/dragonfly#2945
- feat: implement json.merge by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2960
- fix: fix deadlock and slot flush for migration cancel
[#&#8203;2968](https://togithub.com/dragonflydb/dragonfly/issues/2968)
by [@&#8203;BorysTheDev](https://togithub.com/BorysTheDev) in
[dragonflydb/dragonfly#2972
- chore(tiering): Lots of metrics by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2977
- fix: crash during migration when connection is closing by
[@&#8203;kostasrim](https://togithub.com/kostasrim) in
[dragonflydb/dragonfly#2973
- fix: remove acl-check and cancel instead when REPLCONF ACK fails to
validate by [@&#8203;kostasrim](https://togithub.com/kostasrim) in
[dragonflydb/dragonfly#2920
- fix: check return code of process after communicate by
[@&#8203;kostasrim](https://togithub.com/kostasrim) in
[dragonflydb/dragonfly#2976
- fix: allow non hashed passwords when loading users from acl file by
[@&#8203;kostasrim](https://togithub.com/kostasrim) in
[dragonflydb/dragonfly#2982
- chore: update our container distributions versions by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2983
- chore: remove version checks when running our regtests by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2988
- chore(acl): add vlog and check on deluser flow by
[@&#8203;kostasrim](https://togithub.com/kostasrim) in
[dragonflydb/dragonfly#2995
- fix(memcached): Register memcached listener to handle `--maxclients`
by [@&#8203;chakaz](https://togithub.com/chakaz) in
[dragonflydb/dragonfly#2985
- chore: another preparation commit to get rid of kv_args in transaction
by [@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2996
- chore: improve performance of Scan operation by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2990
- fix(server): small string allocations only under 256 bytes str by
[@&#8203;adiholden](https://togithub.com/adiholden) in
[dragonflydb/dragonfly#2991
- fix(cluster-migration): Support cancelling migration right after
starting it by [@&#8203;chakaz](https://togithub.com/chakaz) in
[dragonflydb/dragonfly#2992
- chore: fix double header issue by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#3002
- chore: small tiering fixes by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2966
- feat(benchmark-tests): run in K8s by
[@&#8203;zacharya19](https://togithub.com/zacharya19) in
[dragonflydb/dragonfly#2965
- Benchmark fixes by
[@&#8203;zacharya19](https://togithub.com/zacharya19) in
[dragonflydb/dragonfly#3005
- fix(tiering): rename v2 + max_file_size by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#3004
- chore: fix tiering macos stub by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#3006
- chore: export listener stats by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#3007
- chore: pull latest helio by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#3009
- fix(server): lag is 0 when server not in stable state by
[@&#8203;adiholden](https://togithub.com/adiholden) in
[dragonflydb/dragonfly#3010
- chore: get rid of kv_args and replace it with slices to full_args by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2942
- fix(server): non auto journal write after callback finish by
[@&#8203;adiholden](https://togithub.com/adiholden) in
[dragonflydb/dragonfly#3016
- fix(server): shrink replication steaming buf by
[@&#8203;adiholden](https://togithub.com/adiholden) in
[dragonflydb/dragonfly#3012
- fix(zset): fix random in ZRANDMEMBER command by
[@&#8203;BagritsevichStepan](https://togithub.com/BagritsevichStepan) in
[dragonflydb/dragonfly#2994
- Fix benchmark by [@&#8203;adiholden](https://togithub.com/adiholden)
in
[dragonflydb/dragonfly#3017
- chore: Remove tiering test skip by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#3011
- feat(tiering): simple offload loop by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2987
- feat(tiering): MGET support by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#3013
- Revert "chore: get rid of kv_args and replace it with slices to
full\_… by [@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#3024
- chore(dash): Replace comparator with predicate by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#3025
- feat: add defragment command by
[@&#8203;BorysTheDev](https://togithub.com/BorysTheDev) in
[dragonflydb/dragonfly#3003

##### Huge thanks to all the contributors! ❤️

##### New Contributors

- [@&#8203;racamirko](https://togithub.com/racamirko) made their first
contribution in
[dragonflydb/dragonfly#2940
- [@&#8203;BagritsevichStepan](https://togithub.com/BagritsevichStepan)
made their first contribution in
[dragonflydb/dragonfly#2994

**Full Changelog**:
dragonflydb/dragonfly@v1.17.0...v1.18.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNTIuMCIsInVwZGF0ZWRJblZlciI6IjM3LjM1Mi4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL21pbm9yIl19-->

Co-authored-by: kireque-bot[bot] <143391978+kireque-bot[bot]@users.noreply.github.com>
lumiere-bot bot added a commit to coolguy1771/home-ops that referenced this pull request May 11, 2024
…18.0 ) (#4656)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[ghcr.io/dragonflydb/dragonfly](https://togithub.com/dragonflydb/dragonfly)
| minor | `v1.17.1` -> `v1.18.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>dragonflydb/dragonfly (ghcr.io/dragonflydb/dragonfly)</summary>

###
[`v1.18.0`](https://togithub.com/dragonflydb/dragonfly/releases/tag/v1.18.0)

[Compare
Source](https://togithub.com/dragonflydb/dragonfly/compare/v1.17.1...v1.18.0)

##### Dragonfly v1.18.0

Some prominent changes include:

- ACL improvements:
[#&#8203;2945](https://togithub.com/dragonflydb/dragonfly/issues/2945)
[#&#8203;2943](https://togithub.com/dragonflydb/dragonfly/issues/2943)
[#&#8203;2920](https://togithub.com/dragonflydb/dragonfly/issues/2920)
[#&#8203;2982](https://togithub.com/dragonflydb/dragonfly/issues/2982)
[#&#8203;2995](https://togithub.com/dragonflydb/dragonfly/issues/2995)
- Implementation of json.merge
[#&#8203;2960](https://togithub.com/dragonflydb/dragonfly/issues/2960)
-   Replication - memory improvements
- Very much alpha support for data tiering. Try it out with
`--tiered_prefix=/pathto/ssd/base` and see how your memory usage goes
down (STRING type only). Do not use it in prod! 😸

##### What's Changed

- feat: retry ACK if the configs are different
[#&#8203;2833](https://togithub.com/dragonflydb/dragonfly/issues/2833)
by [@&#8203;BorysTheDev](https://togithub.com/BorysTheDev) in
[dragonflydb/dragonfly#2906
- chore(tiering): Update Get, Set, Del by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2897
- chore: preparation step for lock fingerprints by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2899
- fix(transaction): Use FinishHop in schedule by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2911
- chore(tiering): Fix MacOs build by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2913
- feat(cluster): Migration cancellation support by
[@&#8203;chakaz](https://togithub.com/chakaz) in
[dragonflydb/dragonfly#2869
- feat: process migration data after FIN opcode
[#&#8203;2864](https://togithub.com/dragonflydb/dragonfly/issues/2864)
by [@&#8203;BorysTheDev](https://togithub.com/BorysTheDev) in
[dragonflydb/dragonfly#2918
- chore(string_family): Refactor SetCmd by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2919
- fix: Improve reply latency of HELLO by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2925
- chore: improve reply latency of SendScoredArray by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2929
- Namespace support in prometheus rule by
[@&#8203;Pothulapati](https://togithub.com/Pothulapati) in
[dragonflydb/dragonfly#2931
- fix: socket closed when RegisterOnErrorCb is called in HandleRequests
by [@&#8203;kostasrim](https://togithub.com/kostasrim) in
[dragonflydb/dragonfly#2932
- chore: bring more clarity when replayer fails by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2933
- Slot migration cancel crash fix by
[@&#8203;BorysTheDev](https://togithub.com/BorysTheDev) in
[dragonflydb/dragonfly#2934
- feat: add ability reaply config with migration
[#&#8203;2924](https://togithub.com/dragonflydb/dragonfly/issues/2924)
by [@&#8203;BorysTheDev](https://togithub.com/BorysTheDev) in
[dragonflydb/dragonfly#2926
- fix(test): Unflake fuzzy cluster migration test by
[@&#8203;chakaz](https://togithub.com/chakaz) in
[dragonflydb/dragonfly#2927
- chore: Remove Schedule() call by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2938
- chore: get rid of lock keys by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2894
- fix: introduce info_replication_valkey_compatible flag by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2936
- feat(metrics): adding max_clients to metrics and info output
([#&#8203;2912](https://togithub.com/dragonflydb/dragonfly/issues/2912))
by [@&#8203;racamirko](https://togithub.com/racamirko) in
[dragonflydb/dragonfly#2940
- chore: adjust transaction code to keystep/3 commands by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2941
- feat(tiering): Get, GetSet, Set test by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2921
- chore(acl): adjust some ACL command responses by
[@&#8203;Niennienzz](https://togithub.com/Niennienzz) in
[dragonflydb/dragonfly#2943
- chore: Pull helio with new future by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2944
- refactor: add cluster namespace by
[@&#8203;BorysTheDev](https://togithub.com/BorysTheDev) in
[dragonflydb/dragonfly#2948
- chore: Introduce ShardArgs as a distinct type by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2952
- chore: Log db_index in traffic logger by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2951
- fixes for v1.18.0 by
[@&#8203;adiholden](https://togithub.com/adiholden) in
[dragonflydb/dragonfly#2956
- feat(tiering): Support append (and modifications in general) by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2949
- feat: extended bracket index in jsonpath by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2954
- chore: Remove TieringV1 by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2962
- fix(pytests): replace proc.wait() with proc.communicate() to avoid
deadlocks by [@&#8203;kostasrim](https://togithub.com/kostasrim) in
[dragonflydb/dragonfly#2964
- feat(tiering): Registered buffers by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2967
- feat: add slot migration error processing by
[@&#8203;BorysTheDev](https://togithub.com/BorysTheDev) in
[dragonflydb/dragonfly#2957
- chore(acl): allow multiple users in acl deluser by
[@&#8203;kostasrim](https://togithub.com/kostasrim) in
[dragonflydb/dragonfly#2945
- feat: implement json.merge by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2960
- fix: fix deadlock and slot flush for migration cancel
[#&#8203;2968](https://togithub.com/dragonflydb/dragonfly/issues/2968)
by [@&#8203;BorysTheDev](https://togithub.com/BorysTheDev) in
[dragonflydb/dragonfly#2972
- chore(tiering): Lots of metrics by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2977
- fix: crash during migration when connection is closing by
[@&#8203;kostasrim](https://togithub.com/kostasrim) in
[dragonflydb/dragonfly#2973
- fix: remove acl-check and cancel instead when REPLCONF ACK fails to
validate by [@&#8203;kostasrim](https://togithub.com/kostasrim) in
[dragonflydb/dragonfly#2920
- fix: check return code of process after communicate by
[@&#8203;kostasrim](https://togithub.com/kostasrim) in
[dragonflydb/dragonfly#2976
- fix: allow non hashed passwords when loading users from acl file by
[@&#8203;kostasrim](https://togithub.com/kostasrim) in
[dragonflydb/dragonfly#2982
- chore: update our container distributions versions by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2983
- chore: remove version checks when running our regtests by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2988
- chore(acl): add vlog and check on deluser flow by
[@&#8203;kostasrim](https://togithub.com/kostasrim) in
[dragonflydb/dragonfly#2995
- fix(memcached): Register memcached listener to handle `--maxclients`
by [@&#8203;chakaz](https://togithub.com/chakaz) in
[dragonflydb/dragonfly#2985
- chore: another preparation commit to get rid of kv_args in transaction
by [@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2996
- chore: improve performance of Scan operation by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2990
- fix(server): small string allocations only under 256 bytes str by
[@&#8203;adiholden](https://togithub.com/adiholden) in
[dragonflydb/dragonfly#2991
- fix(cluster-migration): Support cancelling migration right after
starting it by [@&#8203;chakaz](https://togithub.com/chakaz) in
[dragonflydb/dragonfly#2992
- chore: fix double header issue by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#3002
- chore: small tiering fixes by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2966
- feat(benchmark-tests): run in K8s by
[@&#8203;zacharya19](https://togithub.com/zacharya19) in
[dragonflydb/dragonfly#2965
- Benchmark fixes by
[@&#8203;zacharya19](https://togithub.com/zacharya19) in
[dragonflydb/dragonfly#3005
- fix(tiering): rename v2 + max_file_size by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#3004
- chore: fix tiering macos stub by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#3006
- chore: export listener stats by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#3007
- chore: pull latest helio by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#3009
- fix(server): lag is 0 when server not in stable state by
[@&#8203;adiholden](https://togithub.com/adiholden) in
[dragonflydb/dragonfly#3010
- chore: get rid of kv_args and replace it with slices to full_args by
[@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#2942
- fix(server): non auto journal write after callback finish by
[@&#8203;adiholden](https://togithub.com/adiholden) in
[dragonflydb/dragonfly#3016
- fix(server): shrink replication steaming buf by
[@&#8203;adiholden](https://togithub.com/adiholden) in
[dragonflydb/dragonfly#3012
- fix(zset): fix random in ZRANDMEMBER command by
[@&#8203;BagritsevichStepan](https://togithub.com/BagritsevichStepan) in
[dragonflydb/dragonfly#2994
- Fix benchmark by [@&#8203;adiholden](https://togithub.com/adiholden)
in
[dragonflydb/dragonfly#3017
- chore: Remove tiering test skip by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#3011
- feat(tiering): simple offload loop by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#2987
- feat(tiering): MGET support by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#3013
- Revert "chore: get rid of kv_args and replace it with slices to
full\_… by [@&#8203;romange](https://togithub.com/romange) in
[dragonflydb/dragonfly#3024
- chore(dash): Replace comparator with predicate by
[@&#8203;dranikpg](https://togithub.com/dranikpg) in
[dragonflydb/dragonfly#3025
- feat: add defragment command by
[@&#8203;BorysTheDev](https://togithub.com/BorysTheDev) in
[dragonflydb/dragonfly#3003

##### Huge thanks to all the contributors! ❤️

##### New Contributors

- [@&#8203;racamirko](https://togithub.com/racamirko) made their first
contribution in
[dragonflydb/dragonfly#2940
- [@&#8203;BagritsevichStepan](https://togithub.com/BagritsevichStepan)
made their first contribution in
[dragonflydb/dragonfly#2994

**Full Changelog**:
dragonflydb/dragonfly@v1.17.0...v1.18.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNTIuMCIsInVwZGF0ZWRJblZlciI6IjM3LjM1Mi4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL21pbm9yIl19-->

Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ZRANDMEMBER only ever returns first n elements in sorted set
4 participants