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

logstore: introduce logstore.Engine #93889

Closed
wants to merge 1 commit into from
Closed

Conversation

tbg
Copy link
Member

@tbg tbg commented Dec 19, 2022

This introduces the concept of an Engine specific for use in a log
store. In other words, it's the beginnings of a logical separation of
the state machine and log engines, i.e. #16624.

For now, both continue to be backed by the same storage.Engine, and
LogEngine is not correctly used in all places. For example, snapshot
application hasn't yet been updated to account for the possibility
of two separate engines and writes a set of SSTS that is atomically
ingested into the single engine currently present but which logically
spans both engines (#93251).

Touches #93243.

Epic: CRDB-220
Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

This introduces the concept of an Engine specific for use in a log
store. In other words, it's the beginnings of a logical separation of
the state machine and log engines, i.e. cockroachdb#16624.

For now, both continue to be backed by the same storage.Engine, and
LogEngine is not correctly used in all places. For example, snapshot
application hasn't yet been updated to account for the possibility
of two separate engines and writes a set of SSTS that is atomically
ingested into the single engine currently present but which logically
spans both engines (cockroachdb#93251).

Epic: CRDB-220
Release note: None
@tbg tbg marked this pull request as ready for review December 19, 2022 08:17
@tbg tbg requested a review from a team December 19, 2022 08:17
@tbg tbg requested a review from a team as a code owner December 19, 2022 08:17
@tbg
Copy link
Member Author

tbg commented Dec 19, 2022

We need to talk about whether this approach is the right one. I can't think of a good alternative off-hand and I think we should have some type safety, but if you continue on this approach you'll change the storage.Writer params in, e.g., SetHardState to a similar logstore.Writer interface, and now you have the problem that when we create the batch in handleRaftReady we need to wrap it in an extra interface (with, I think, an extra allocation), which is not great.

@tbg
Copy link
Member Author

tbg commented Dec 19, 2022

We chatted earlier and we'll hold off on this a bit; it's mostly cosmetic anyway. Our time is better spent elsewhere for now.

@tbg tbg closed this Dec 19, 2022
@tbg tbg deleted the sep-log-93243 branch December 20, 2022 10:03
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.

2 participants