Repository navigation
Conversation
| @@ -1056,7 +1126,8 @@ def test_pool_min_size(self): | |||
| # further reducing redundancy. With this number of injects in | |||
| # quick succession this risks a PG in the pool becoming dead | |||
| for i in range(0, most_killable): | |||
| self.kill_osd(osd=acting_set[i]) | |||
| # Explicitly disable min_size protection - this test wants to test min_size behavior | |||
| self.kill_osd(osd=acting_set[i], respect_min_size=False) | |||
There was a problem hiding this comment.
I'm afraid kill_osd() might have more users like this one. Defaulting respect_min_size to True is pretty impactful.
How many callers does kill_osd() have?
| @@ -29,6 +29,7 @@ overrides: | |||
| - osds down | |||
| - osd down | |||
| - OBJECT_UNFOUND | |||
| - PG_DAMAGED | |||
There was a problem hiding this comment.
Maybe we should split this into its own PR as I think it is just this that is required to make the test pass?
There was a problem hiding this comment.
Yeah, looks the PG_DAMAGED doesn't require any further discussion.
| @@ -337,14 +337,84 @@ def run_ceph_bluestore_tool(self, remote, osd, cmd): | |||
| stdout=StringIO(), | |||
| stderr=StringIO()) | |||
|
|
|||
| def kill_osd(self, osd=None, mark_down=False, mark_out=False): | |||
| def _get_safe_to_kill_osds(self): | |||
There was a problem hiding this comment.
👍 I really like the idea of this function, in particular I'd like to be able to run qa tests with a mixture of different EC pools with different levels of redundancy, or a mix of EC and replica pools,. Currently this doesn't work well because the thrasher selects a pool to perform an error inject and disregards the state of the PGs in the other pools when injecting errors, but then does things like waiting for active+clean or recovered which fail when a PG is dead because of too many injects.
|
|
||
| return list(safe_osds) | ||
|
|
||
| def kill_osd(self, osd=None, mark_down=False, mark_out=False, respect_min_size=True): |
There was a problem hiding this comment.
I don't like the idea of enabling respect_min_size by default, I think it should be opt in rather than opt out. I can't decide whether this should be something that individual error injects select (e.g. within OSDThrasher) or whether this should be something that is set at the teuthology run level by a yaml setting
| osd = random.choice(safe_osds) | ||
| self.log(f'Selected OSD {osd} from {len(safe_osds)} safe candidates') | ||
| else: | ||
| # No safe OSDs - allow violation with low probability for edge case testing |
There was a problem hiding this comment.
I don't think this is a good idea. I get what you are trying to do - causing a set of error injects that is more realistic and focuses mainly on scenarios that don't take things offline, but allow a few cases that do so we get coverage. My problem with this approach is that this isn't how the rest of the test cases are written - tests are generally very binary and expect things to go offline or they don't - they don't cope well with a random outcome. All this will do is make it slightly less likely that a test will fail
I was also confused by the naming of the respect_min_size parameter which made me think it wouldn't violate min_size and then this code that sometimes does, if we keep this then maybe the parameter should be try_respect_min_size?
| @@ -1056,7 +1126,8 @@ def test_pool_min_size(self): | |||
| # further reducing redundancy. With this number of injects in | |||
| # quick succession this risks a PG in the pool becoming dead | |||
| for i in range(0, most_killable): | |||
| self.kill_osd(osd=acting_set[i]) | |||
| # Explicitly disable min_size protection - this test wants to test min_size behavior | |||
| self.kill_osd(osd=acting_set[i], respect_min_size=False) | |||
There was a problem hiding this comment.
This is a bit unintuitive, this particular error inject is trying to reduce the size of a pool to min size, but not below min size - it is already querying the min size of the pool to work out how many PGs it should be able to kill. If this test is running on its own with just one pool then there should be no need to set this, if the test is running with other error injects as well then just selecting it here isn't going to help. What is the justification for setting it here?
| @@ -29,6 +29,7 @@ overrides: | |||
| - osds down | |||
| - osd down | |||
| - OBJECT_UNFOUND | |||
| - PG_DAMAGED | |||
There was a problem hiding this comment.
Maybe we should split this into its own PR as I think it is just this that is required to make the test pass?
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
Problem: The OSD thrasher randomly kills OSDs without checking if it would violate any PG's min_size. This leads to data loss scenarios where multiple OSDs in the same acting set are killed in quick succession, leaving PGs with fewer replicas than min_size and resulting in unfound objects that cannot be recovered. Solution: Add opt-in protection to kill_osd() that checks PG states before selecting an OSD to kill: 1. New _get_safe_to_kill_osds() method identifies OSDs whose death would not violate any PG's min_size by checking acting sets against pool min_size values. 2. Modified kill_osd() to accept respect_min_size parameter (default False): 3. Updated test_pool_min_size() to explicitly set respect_min_size=False since that test intentionally violates min_size. This provides protection against systematic min_size violations while Signed-off-by: Kamoltat (Junior) Sirivadhna <[email protected]>
522eb8c to
23dc84b
Compare
|
@rzarzynski @bill-scales I have separate the PRs into two where:
This current PR creates the option for kill_osd to protect min_size but is not yet used anywhere yet. I'm not sure if we want to protect min_size when we roll the dice in |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
@rzarzynski just need a quick review. Thanks! |
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
ljflores
left a comment
There was a problem hiding this comment.
Added some thoughts. I do think this could also be helpful in resolving https://tracker.ceph.com/issues/75216.
| for pg in pgs: | ||
| pool_id = int(pg['pgid'].split('.')[0]) |
There was a problem hiding this comment.
Can we iterate through the pools rather than the PGs? That could cut down on the run time of this loop.
| # If this PG is at or below min_size, don't kill any of its OSDs | ||
| if len(acting) <= min_size: | ||
| for osd in acting: | ||
| if osd in safe_osds: | ||
| safe_osds.discard(osd) | ||
| self.log(f'OSD {osd} cannot be killed: PG {pg["pgid"]} ' | ||
| f'has acting set {acting} at/below min_size {min_size}') |
There was a problem hiding this comment.
This implies that PGs might have different min_sizes, so we will just ignore the ones that are at or below min_size.
However, I think min_size is hard-coded in all the thrashers to be 2. For example: https://github.com/ceph/ceph/blob/main/qa/suites/rados/thrash/thrashers/pggrow.yaml
That means we might skip over all PGs and never thrash anything. Would it be better to dynamically adjust min_size to be whatever the largest "k" value is in the cluster?
That way, we will still have some thrashing activity going on.
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
Problem:
The OSD thrasher randomly kills OSDs without checking if it would
violate any PG's min_size. This leads to data loss scenarios
where multiple OSDs in the same acting set are killed in quick succession,
leaving PGs with fewer replicas than min_size and resulting in unfound
objects that cannot be recovered.
Solution:
Add opt-in protection to kill_osd() that checks PG states before selecting
an OSD to kill:
Signed-off-by: Kamoltat (Junior) Sirivadhna [email protected]
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.