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

storage: change map type for _db in kvstore #18499

Merged
merged 1 commit into from
May 15, 2024

Conversation

WillemKauf
Copy link
Contributor

@WillemKauf WillemKauf commented May 15, 2024

In an effort to move to fragmented data structures, the absl::btree_map type used in the kvstore is now replaced by a chunked_hash_map.

We do not rely on the ordering or any sort of pointer/reference/iterator stability provided by absl::btree_map in our current uses of _db, so this is a painless swap.

Fixes #15906
Fixes #10744

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v24.1.x
  • v23.3.x
  • v23.2.x

Release Notes

  • none

Copy link
Member

@StephanDollberg StephanDollberg left a comment

Choose a reason for hiding this comment

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

I think those issues are actually already fixed by Tyler's commit from 3 months ago changing this from a node_hash_map to a btree_map.

However we didn't have chunked_hash_map back then so this is the right thing to do either way.

#include "bytes/iobuf.h"
#include "container/chunked_hash_map.h"
#include "metrics/metrics.h"
#include "storage/fwd.h"
#include "storage/ntp_config.h"
Copy link
Member

Choose a reason for hiding this comment

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

good to remove the btree include further down?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, fixed!

@StephanDollberg
Copy link
Member

also backport to 24.1 at least?

In an effort to move to fragmented data structures, the `absl::btree_map`
type used in the `kvstore` is now replaced by a `chunked_hash_map`.

We do not rely on the ordering or any sort of pointer/reference/iterator
stability provided by `absl::btree_map` in our current uses of `_db`, so
this is a painless swap.
@WillemKauf WillemKauf merged commit 916ec2d into redpanda-data:dev May 15, 2024
18 checks passed
@vbotbuildovich
Copy link
Collaborator

/backport v24.1.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants