[LU-11423] osc_extent_find sometimes walks full extent list Created: 24/Sep/18  Updated: 06/Nov/18  Resolved: 06/Nov/18

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: Lustre 2.12.0

Type: Bug Priority: Minor
Reporter: Patrick Farrell (Inactive) Assignee: Patrick Farrell (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

osc_extent_find has an interesting little bug.

osc_extent_find uses osc_extent_search to find a good candidate for merging the new page in to, then starts checking.  osc_extent_search either the extent containing the offset request or the greatest previous extent, or null if no such extent exists.

If search returns null, then find uses the first extent of the object.

Basically, there are three possibilities, assuming there are some extents in the object:

  1. The new offset lies inside and existing extent, ie, overlaps it.  Search returns this extent and find handles this case.
  2. There are no earlier extents in the object.  If there are any extents, try to merge with the first extent (which must be the next extent).  If we cannot merge with this extent, then we will not be able to merge with any further extents.  (Because they are guaranteed to be discontiguous.)
  3. There is an earlier extent.  Try to merge with it.  If that fails, try to merge with the next extent in the file.  If we cannot merge with it, then we can't merge with any further extents (because they are guaranteed to be discontiguous).

In cases 2 and 3, the current code will continue to walk the extent list until next_extent is NULL.  This is fine for small numbers of extents, but is hugely problematic for large, sparse files with small written extents, where we can get thousands and thousands of extents and most new writes will not merge with existing extents.

This is trivial to fix - just stop walking the extent list once we've passed any extents we could match.  Patch will be forthcoming shortly.



 Comments   
Comment by Gerrit Updater [ 24/Sep/18 ]

Patrick Farrell (paf@cray.com) uploaded a new patch: https://review.whamcloud.com/33227
Subject: LU-11423 osc: Do not walk full extent list
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: e5ed4bb98bd4e17fb6bb5bd7d4fe22b660e33341

Comment by Gerrit Updater [ 06/Nov/18 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33227/
Subject: LU-11423 osc: Do not walk full extent list
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 7f8143cf85b7e658976aa6526689628a81ed6a32

Comment by Peter Jones [ 06/Nov/18 ]

Landed for 2.12

Generated at Sat Feb 10 02:43:45 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.