@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
## Task 1: Implement Watermark
|
## Task 1: Implement Watermark
|
||||||
|
|
||||||
## Task 2: Garbage Collection in Compaction
|
## Task 2: Maintain Watermark in Transactions
|
||||||
|
|
||||||
|
## Task 3: Garbage Collection in Compaction
|
||||||
|
|
||||||
|
|
||||||
{{#include copyright.md}}
|
{{#include copyright.md}}
|
||||||
|
|||||||
@@ -8,8 +8,12 @@
|
|||||||
|
|
||||||
## Test Your Understanding
|
## Test Your Understanding
|
||||||
|
|
||||||
* If you have some experience with building a relational database, you may think about the following question: assume that we build a database based on Mini-LSM where we store each row in the relation table as a key-value pair and enable serializable verification, does the database system directly get ANSI serializable isolation level capability? Why or why not?
|
* If you have some experience with building a relational database, you may think about the following question: assume that we build a database based on Mini-LSM where we store each row in the relation table as a key-value pair (key: primary key, value: serialized row) and enable serializable verification, does the database system directly gain ANSI serializable isolation level capability? Why or why not?
|
||||||
|
|
||||||
We do not provide reference answers to the questions, and feel free to discuss about them in the Discord community.
|
We do not provide reference answers to the questions, and feel free to discuss about them in the Discord community.
|
||||||
|
|
||||||
|
## Bonus Tasks
|
||||||
|
|
||||||
|
* **Read-Only Transactions.**
|
||||||
|
|
||||||
{{#include copyright.md}}
|
{{#include copyright.md}}
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ impl Watermark {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn num_retained_snapshots(&self) -> usize {
|
||||||
|
self.readers.len()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn watermark(&self) -> Option<u64> {
|
pub fn watermark(&self) -> Option<u64> {
|
||||||
self.readers.first_key_value().map(|(ts, _)| *ts)
|
self.readers.first_key_value().map(|(ts, _)| *ts)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user