-
Notifications
You must be signed in to change notification settings - Fork 218
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
Improve status reporting in UI #1262
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
7d3abf9
Migration to add secondary index on repair runs table.
Miles-Garnsey 37d6eaf
RepairRunResource should prioritise RUNNING repairs when a limit is p…
Miles-Garnsey b06d357
Stub out the bones of queries required to use new secondary index.
Miles-Garnsey 21e3e7a
Shift around order or RepairRun.RunState so it reflects our desired o…
Miles-Garnsey 8af069e
Implement getRepairRunsForClusterPrioritiseRunning for MemoryStorage.
Miles-Garnsey 12046fe
Additional import for CassandraStorage.
Miles-Garnsey e31d419
Checkstyle, rename migration.
Miles-Garnsey bced1f1
A more elegant way to iterate over the RunStates and query for them.
Miles-Garnsey e0d0bf9
Checkstyle, make sure MemoryStorage returns only the first <limit> ro…
Miles-Garnsey d61b8d6
Fix use of incorrectly named column in `getRepairRunForClusterWhereSt…
Miles-Garnsey def2799
Use index table `repair_run_by_cluster_v2` to obtain UUIDs for cluste…
Miles-Garnsey b5c0989
Avoid out of bounds list indices by ensuring that we always use min(l…
Miles-Garnsey 2ee5be8
Integration test definition.
Miles-Garnsey 094c190
Re-order the RunState enum according to clarified requirements.
Miles-Garnsey 1bb531f
Checkstyle...
Miles-Garnsey 5e126e6
Rework the storage layer queries so that they only use 2i for high pr…
Miles-Garnsey 6c6028f
Fix acceptance test arity issue.
Miles-Garnsey 330b0bb
Alex's suggestions.
Miles-Garnsey d2e65be
Fix deserialisation problem when getting RepairRun back from API.
Miles-Garnsey e8d061e
Fix test logic so that repair runs > 1 are aborted and repair run 1 i…
Miles-Garnsey 23c06d1
Need to set repair run to RUNNING before pausing/aborting.
Miles-Garnsey 4cf7a80
While loop not terminating in tests, let's try a for loop.
Miles-Garnsey e38cc83
Make number of repairs added and aborted configurable.
Miles-Garnsey 86d3a5a
Update src/server/src/main/resources/db/cassandra/032_add_2i_status.cql
Miles-Garnsey 3d9e2f0
Add additional test to check RepairRunStatus ordering against `/repai…
Miles-Garnsey aa8fb9c
New ordering function for Lists of RepairRuns, using `isTerminated()`…
Miles-Garnsey 093633c
Checkstyle...
Miles-Garnsey e935f54
Move `SortByRunState()` into `RepairRunService`.
Miles-Garnsey 106043f
Use getRepairRunsForCluster for the repair_runs/ endpoint.
Miles-Garnsey ccc1f3e
Checkstyle...
Miles-Garnsey b9320a4
Flip the ordering in RunState comparator.
Miles-Garnsey b23b40e
Simplify filtering logic for runstates in CassandraStorage.
Miles-Garnsey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/server/src/main/resources/db/cassandra/032_add_2i_status.cql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-- | ||
-- Copyright 2021-2021 Datastax inc. | ||
-- | ||
-- Licensed under the Apache License, Version 2.0 (the "License"); | ||
-- you may not use this file except in compliance with the License. | ||
-- You may obtain a copy of the License at | ||
-- | ||
-- http://www.apache.org/licenses/LICENSE-2.0 | ||
-- | ||
-- Unless required by applicable law or agreed to in writing, software | ||
-- distributed under the License is distributed on an "AS IS" BASIS, | ||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
-- See the License for the specific language governing permissions and | ||
-- limitations under the License. | ||
-- | ||
-- Add a secondary index on `state` to the `repair_run` table. | ||
|
||
CREATE INDEX IF NOT EXISTS state2i ON repair_run_by_cluster_v2 (repair_run_state); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
You need to do the same on line 665. It's the method that lists repair runs throughput all registered clusters.
Currently it's still using the old
getRepairRunsForCluster()
method which isn't optimized to prioritize running repairs.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 problem is that on line 665, it is adding the runs from ALL clusters into a list. I'll need to re-sort the runs so that the statuses are in the right order irrespective of cluster. Once you let me know the precise way you want the sorting done, I might just encapsulate it in a function so that we aren't duplicating that logic in multiple places.
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.
Right, you'll need to merge lists from different clusters and re-sort to apply the limits.
FYI, repair ids are timeuuids, which makes it possible to apply the sorting on them directly using their time component.
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.
This appears to be done and working now, although the cucumber test doesn't test against multiple clusters. I'm not sure if I should add a multi-cluster test to confirm that this endpoint does indeed work?
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 think that would be fairly hard to achieve with the limited resources we have at our disposal.
A mocked test wouldn't help much I guess, so we're left with manual testing for multi cluster 🤷