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

log: Clean up election in the operation loop #2290

Merged
merged 8 commits into from
Jan 22, 2021

Conversation

pav-kv
Copy link
Contributor

@pav-kv pav-kv commented Jan 22, 2021

Comments, variable renames, and factoring out some code.
Review commit by commit.

This is in preparation for fixing #1150.

The operation manager only needs the cancel functions to stop all the
Runners in the end.
@pav-kv pav-kv requested review from AlCutter and Martin2112 January 22, 2021 14:37
@pav-kv pav-kv requested a review from a team as a code owner January 22, 2021 14:37
@google-cla google-cla bot added the cla: yes label Jan 22, 2021
@pav-kv
Copy link
Contributor Author

pav-kv commented Jan 22, 2021

Note: This is a cosmetic PR. It's convenient to review commit-by-commit.

log/operation_manager.go Show resolved Hide resolved
log/operation_manager.go Show resolved Hide resolved
@pav-kv pav-kv force-pushed the cleanup_election_runner branch from 4f34502 to cff31b1 Compare January 22, 2021 14:57
log/operation_manager.go Outdated Show resolved Hide resolved
@pav-kv pav-kv force-pushed the cleanup_election_runner branch from cff31b1 to 5f7e959 Compare January 22, 2021 15:03
@pav-kv
Copy link
Contributor Author

pav-kv commented Jan 22, 2021

All comments are addressed.

@pav-kv
Copy link
Contributor Author

pav-kv commented Jan 22, 2021

Interesting: https://travis-ci.org/github/google/trillian/jobs/755698264
WARNING: DATA RACE.
I'm taking a look at it.

@pav-kv
Copy link
Contributor Author

pav-kv commented Jan 22, 2021

Got it: NewRunner takes ElectionConfig by pointer, and tries to modify it in Run method. The config is also used in other places. It probably shouldn't be used by pointer.

@Martin2112
Copy link
Contributor

Are the modifications in NewRunner necessary for it to work? It might not be entirely straightforward to fix.

@pav-kv
Copy link
Contributor Author

pav-kv commented Jan 22, 2021

The modifications are not necessary (there is a TODO to move them out), but I'm reluctant to touch it for now.
I made a simpler fix: copy the config for each log.

@Martin2112
Copy link
Contributor

OK that sounds like it should work.

@pav-kv
Copy link
Contributor Author

pav-kv commented Jan 22, 2021

There is an unrelated test failure TestLogSuite/DequeueLeavesTwoBatches for the in-memory CloudSpanner instance. It's flaky because the in-memory CloudSpanner doesn't actually implement transactions.

@Martin2112
Copy link
Contributor

OK.

@pav-kv
Copy link
Contributor Author

pav-kv commented Jan 22, 2021

Added a commit with a minor comment to trigger builds again.

@pav-kv pav-kv merged commit 69cdc7c into google:master Jan 22, 2021
@pav-kv pav-kv deleted the cleanup_election_runner branch January 22, 2021 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants