-
Notifications
You must be signed in to change notification settings - Fork 107
docs(l1): tradeoffs of transactional RocksDB modes #4744
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
Conversation
A brief pros and cons list to decide whether to turn off optimistic transactions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds an internal documentation page outlining pros/cons of using Optimistic, Pessimistic, or Non-Transactional RocksDB modes to inform a decision about disabling optimistic transactions.
- Introduces advantages sections for each transaction mode plus non-transactional usage
- Lists potential alternatives to using DB-level transactions
- Highlights operational considerations for crash recovery and L2 constraints
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@@ -0,0 +1,21 @@ | |||
# Tradeoffs of using or not Optimistic Transaction DB in RocksDB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heading is grammatically awkward; consider rephrasing for clarity.
# Tradeoffs of using or not Optimistic Transaction DB in RocksDB | |
# Tradeoffs of Using Optimistic Transaction DB Versus Not Using It in RocksDB |
Copilot uses AI. Check for mistakes.
- Easier to keep consistency with readers. | ||
|
||
## Advantages of Pessimistic Transactions | ||
- Lower memory usage? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trailing question mark signals uncertainty. Either provide data/supporting rationale or remove the entry until confirmed.
- Lower memory usage? | |
- Lower memory usage (confirm). |
Copilot uses AI. Check for mistakes.
|
||
## Advantages of Non-Transactional DB | ||
- `delete_range`: much faster key deletion in bulk, useful during healing. | ||
- Lower memory usage (confirm). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The '(confirm)' note indicates an unverified claim; replace with concrete information or remove pending validation.
- Lower memory usage (confirm). | |
- Lower memory usage. |
Copilot uses AI. Check for mistakes.
## Advantages of Non-Transactional DB | ||
- `delete_range`: much faster key deletion in bulk, useful during healing. | ||
- Lower memory usage (confirm). | ||
- Secondary instances are either much easier or possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sentence is ambiguous ('either much easier or possible'). Clarify whether non-transactional mode enables secondary instances at all, or simply reduces complexity.
- Secondary instances are either much easier or possible. | |
- Secondary instances are only possible in non-transactional mode. |
Copilot uses AI. Check for mistakes.
- We can provide crash safety by adding checkpoints or explicit markers so we can go back to the last known consistent version. | ||
- We would need to run a healing pass from that point on startup, to fix possible partial changes to tries. | ||
- We would need to add explicit tests for crashing during writes to make sure we recover correctly. | ||
- L2 can't recover from peers (at least until Based), so it should probably remain transactional. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Term 'Based' is unexplained; add a brief definition or link so readers understand the dependency or future milestone.
- L2 can't recover from peers (at least until Based), so it should probably remain transactional. | |
- L2 can't recover from peers (at least until Based[^based]), so it should probably remain transactional. |
Copilot uses AI. Check for mistakes.
- `delete_range`: much faster key deletion in bulk, useful during healing. | ||
- Lower memory usage (confirm). | ||
- Secondary instances are either much easier or possible. | ||
|
||
## Alternatives to DB Transactions | ||
- We can use snapshots/secondary instances to provide a consistent view to block production and protocols. | ||
- We can provide crash safety by adding checkpoints or explicit markers so we can go back to the last known consistent version. | ||
- We would need to run a healing pass from that point on startup, to fix possible partial changes to tries. | ||
- We would need to add explicit tests for crashing during writes to make sure we recover correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider explicitly listing required additional mechanisms (healing pass, crash tests, checkpoints) as 'Operational Requirements' to distinguish them from 'Advantages'; current mix may confuse readers about what is a benefit vs. a cost.
- `delete_range`: much faster key deletion in bulk, useful during healing. | |
- Lower memory usage (confirm). | |
- Secondary instances are either much easier or possible. | |
## Alternatives to DB Transactions | |
- We can use snapshots/secondary instances to provide a consistent view to block production and protocols. | |
- We can provide crash safety by adding checkpoints or explicit markers so we can go back to the last known consistent version. | |
- We would need to run a healing pass from that point on startup, to fix possible partial changes to tries. | |
- We would need to add explicit tests for crashing during writes to make sure we recover correctly. | |
- Lower memory usage (confirm). | |
- Secondary instances are either much easier or possible. | |
## Operational Requirements for Non-Transactional DB | |
- Healing pass: On startup, a healing pass must be run from the last checkpoint to fix possible partial changes to tries. | |
- Crash safety: Explicit tests for crashing during writes are needed to ensure correct recovery. | |
- Checkpoints: Crash safety can be provided by adding checkpoints or explicit markers to allow rollback to the last known consistent version. | |
- `delete_range`: Used for much faster key deletion in bulk, which is especially useful during the healing process. | |
## Alternatives to DB Transactions | |
- We can use snapshots/secondary instances to provide a consistent view to block production and protocols. |
Copilot uses AI. Check for mistakes.
- We can use snapshots/secondary instances to provide a consistent view to block production and protocols. | ||
- We can provide crash safety by adding checkpoints or explicit markers so we can go back to the last known consistent version. | ||
- We would need to run a healing pass from that point on startup, to fix possible partial changes to tries. | ||
- We would need to add explicit tests for crashing during writes to make sure we recover correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider explicitly listing required additional mechanisms (healing pass, crash tests, checkpoints) as 'Operational Requirements' to distinguish them from 'Advantages'; current mix may confuse readers about what is a benefit vs. a cost.
- We can use snapshots/secondary instances to provide a consistent view to block production and protocols. | |
- We can provide crash safety by adding checkpoints or explicit markers so we can go back to the last known consistent version. | |
- We would need to run a healing pass from that point on startup, to fix possible partial changes to tries. | |
- We would need to add explicit tests for crashing during writes to make sure we recover correctly. | |
- We can use snapshots/secondary instances to provide a consistent view to block production and protocols. | |
## Operational Requirements for Non-Transactional DB | |
- We can provide crash safety by adding checkpoints or explicit markers so we can go back to the last known consistent version. | |
- We would need to run a healing pass from that point on startup, to fix possible partial changes to tries. | |
- We would need to add explicit tests for crashing during writes to make sure we recover correctly. |
Copilot uses AI. Check for mistakes.
A brief pros and cons list to decide whether to turn off optimistic
transactions.