-
Notifications
You must be signed in to change notification settings - Fork 110
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
Enable restart tests #35
Conversation
f7489b5
to
ff65bf8
Compare
let rows = st_tables.scan_rows().cloned().collect::<Vec<_>>(); | ||
for row in rows { |
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.
Let's clarify why we collect to then immediately iterate.
.map(|tx_state| tx_state.insert_tables.contains_key(table_id)) | ||
.unwrap_or(false) |
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.
.map(|tx_state| tx_state.insert_tables.contains_key(table_id)) | |
.unwrap_or(false) | |
.map_or(false, |tx_state| tx_state.insert_tables.contains_key(table_id)) |
// Honestly this should maybe just be one big procedure. | ||
// See John Carmack's philosophy on this. |
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.
I much prefer the style of code you've written here to Carmack's philosophy.
Ok(()) | ||
} | ||
|
||
pub fn replay_transaction( |
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.
Docs?
Some(RowOp::Insert) => (), // Do nothing, we'll get it in the next stage | ||
Some(RowOp::Delete) => (), // Skip it, it's been deleted |
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.
Some(RowOp::Insert) => (), // Do nothing, we'll get it in the next stage | |
Some(RowOp::Delete) => (), // Skip it, it's been deleted | |
Some(RowOp::Insert) => {}, // Do nothing, we'll get it in the next stage. | |
Some(RowOp::Delete) => {}, // Skip it, it's been deleted. |
Some(RowOp::Absent) => { | ||
return Some(DataRef::new(row.clone())); | ||
} | ||
None => { | ||
return Some(DataRef::new(row.clone())); | ||
} |
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.
Some(RowOp::Absent) => { | |
return Some(DataRef::new(row.clone())); | |
} | |
None => { | |
return Some(DataRef::new(row.clone())); | |
} | |
Some(RowOp::Absent) | => None => { | |
return Some(DataRef::new(row.clone())); | |
} |
.tx_state | ||
.as_ref() | ||
.and_then(|tx_state| tx_state.insert_tables.get(&self.table_id)) |
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.
Repeated 3x in this file
d5da512
to
6d7bd2e
Compare
fa19e65
to
94c8fa9
Compare
94c8fa9
to
d5da512
Compare
d5da512
to
0127fbc
Compare
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.
LGTM
* Fixes the restart problem (i.e. rebuilding the datastore from the message log) * Remove logging * Enable restart tests * Fixed small issues with tests * Fixed restart-repeating-reducer test probably --------- Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com> Co-authored-by: Boppy <no-reply@boppygames.gg>
* Fixes the restart problem (i.e. rebuilding the datastore from the message log) * Remove logging * Enable restart tests * Fixed small issues with tests * Fixed restart-repeating-reducer test probably --------- Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com> Co-authored-by: Boppy <no-reply@boppygames.gg>
Description of Changes
API
If the API is breaking, please state below what will break