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

Enable restart tests #35

Merged
merged 4 commits into from
Jul 1, 2023
Merged

Enable restart tests #35

merged 4 commits into from
Jul 1, 2023

Conversation

jdetter
Copy link
Collaborator

@jdetter jdetter commented Jun 29, 2023

Description of Changes

  • Enables all docker restart tests in the testsuite

API

  • This is a breaking change to the module API
  • This is a breaking change to the ClientAPI

If the API is breaking, please state below what will break

@jdetter jdetter force-pushed the jdetter/enable-restart-tests branch from f7489b5 to ff65bf8 Compare June 29, 2023 06:46
Comment on lines 417 to 420
let rows = st_tables.scan_rows().cloned().collect::<Vec<_>>();
for row in rows {
Copy link
Contributor

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.

Comment on lines 993 to 996
.map(|tx_state| tx_state.insert_tables.contains_key(table_id))
.unwrap_or(false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.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))

Comment on lines 1414 to 1422
// Honestly this should maybe just be one big procedure.
// See John Carmack's philosophy on this.
Copy link
Contributor

@Centril Centril Jun 29, 2023

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(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs?

Comment on lines 1539 to 1547
Some(RowOp::Insert) => (), // Do nothing, we'll get it in the next stage
Some(RowOp::Delete) => (), // Skip it, it's been deleted
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Comment on lines 1541 to 1553
Some(RowOp::Absent) => {
return Some(DataRef::new(row.clone()));
}
None => {
return Some(DataRef::new(row.clone()));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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()));
}

Comment on lines 1551 to 1560
.tx_state
.as_ref()
.and_then(|tx_state| tx_state.insert_tables.get(&self.table_id))
Copy link
Contributor

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

@jdetter jdetter enabled auto-merge (squash) June 30, 2023 16:09
@jdetter jdetter force-pushed the jdetter/enable-restart-tests branch from d5da512 to 6d7bd2e Compare June 30, 2023 16:11
@jdetter jdetter force-pushed the jdetter/enable-restart-tests branch 2 times, most recently from fa19e65 to 94c8fa9 Compare June 30, 2023 16:55
Copy link
Contributor

@cloutiertyler cloutiertyler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jdetter jdetter merged commit 3d3d117 into master Jul 1, 2023
cloutiertyler added a commit that referenced this pull request Aug 1, 2023
* 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>
cloutiertyler added a commit that referenced this pull request Aug 1, 2023
* 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>
@cloutiertyler cloutiertyler deleted the jdetter/enable-restart-tests branch August 1, 2023 21:53
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.

3 participants