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

raftentry: Cache should hold raftlog.Entry, not raftpb.Entry #99778

Open
tbg opened this issue Mar 28, 2023 · 1 comment
Open

raftentry: Cache should hold raftlog.Entry, not raftpb.Entry #99778

tbg opened this issue Mar 28, 2023 · 1 comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-kv-replication KV Replication Team

Comments

@tbg
Copy link
Member

tbg commented Mar 28, 2023

Is your feature request related to a problem? Please describe.

a raftpb.Entry needs to be unmarshaled, which is expensive. It might make sense to hold the already-unmarshaled raftlog.Entry1 instead.

Describe the solution you'd like

See above.

Describe alternatives you've considered

raftlog.Entry has a larger memory footprint, so there is a trade-off.

Additional context

Our currently raft entry cache sizing seems extremely stingy2 and we should revisit it if we decide to address this issue (and even if we don't!)

Jira issue: CRDB-26072

Footnotes

  1. https://github.com/cockroachdb/cockroach/blob/4df47f54f042355a7b2231a9efc15aa1857d81d5/pkg/kv/kvserver/raftlog/entry.go#L73-L84

  2. https://github.com/cockroachdb/cockroach/issues/98666

@tbg tbg added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-kv-replication KV Replication Team labels Mar 28, 2023
@blathers-crl
Copy link

blathers-crl bot commented Mar 28, 2023

cc @cockroachdb/replication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-kv-replication KV Replication Team
Projects
None yet
Development

No branches or pull requests

1 participant