Repository navigation
[Swift] add simple heuristic to detect incomplete DLOs during read ops - #1710
RichardScothern merged 1 commit into
Conversation
Current coverage is 52.42%@@ master #1710 diff @@
==========================================
Files 120 120
Lines 10477 10502 +25
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
- Hits 6220 5506 -714
- Misses 3425 4254 +829
+ Partials 832 742 -90
|
|
Can we merge this? The patch has been running fine in production in my team's Registry for two weeks now. |
|
This seems fine to me. I'd like someone else with swift knowledge to look at this though @nevermosby @lebauce |
| return nil, fmt.Errorf("Timeout expired while waiting for segments of %s to show up", path) | ||
| } | ||
| time.Sleep(waitingTime) | ||
| waitingTime += 2 |
There was a problem hiding this comment.
This should have a specific units, based on the default for readAfterWriteWait is this intending
waitingTime += 2 * time.Millisecond
There was a problem hiding this comment.
I don't know. I copied the retry logic from waitForSegmentsToShowUp. (I tried to refactor it out into a function, but it became uglier than just copying that small bit.)
There was a problem hiding this comment.
The logic in waitForSegmentsToShowUp is using waitingTime *= 2 doubling the wait time each time. Maybe the *= was swapped for += by mistake?
There was a problem hiding this comment.
Yes, it was. I'll fix this, and rebase the branch on current master while I'm at it.
This is similar to waitForSegmentsToShowUp which is called during Close/Commit. Intuitively, you wouldn't expect missing segments to be a problem during read operations, since the previous Close/Commit confirmed that all segments are there. But due to the distributed nature of Swift, the read request could be hitting a different storage node of the Swift cluster, where the segments are still missing. Load tests on my team's staging Swift cluster have shown this to occur about once every 100-200 layer uploads when the Swift proxies are under high load. The retry logic, borrowed from waitForSegmentsToShowUp, fixes this temporary inconsistency. Signed-off-by: Stefan Majewsky <[email protected]>
|
Is this good to go? Would like to have this in 2.5 so that I can switch back to the official images in my prod env. |
|
Code LGTM. The 2.5 release cutoff has already passed. You can use the |
This have the same motivations and adds a similar behavior to distribution/distribution#1710.
This is similar to waitForSegmentsToShowUp (cf. #1650) which is called during Close/Commit. Intuitively, you wouldn't expect missing segments to be a problem during read operations, since the previous Close/Commit confirmed that all segments are there.
But due to the distributed nature of Swift, the read request could be hitting a different storage node of the Swift cluster, where the segments are still missing.
Load tests on my team's staging Swift cluster have shown this to occur about once every 100-200 layer uploads when the Swift proxies are under high load. The retry logic, borrowed from waitForSegmentsToShowUp, allows the Registry to skip past this temporary inconsistency.
Tip: View the diff with
?w=1.