Skip to content

Fixed push to scaled registry with nfs - #5761

Closed
ashcrow wants to merge 2 commits into
openshift:masterfrom
ashcrow:fixed-push-to-scaled-registry-with-nfs
Closed

ashcrow wants to merge 2 commits into
openshift:masterfrom
ashcrow:fixed-push-to-scaled-registry-with-nfs

Conversation

@ashcrow

@ashcrow ashcrow commented Nov 6, 2015

Copy link
Copy Markdown
Member

Original PR: #5749

On NFS it takes some time for filesystem changes to propagate to other
instances. Several operations need to be retried until successful.

Resolves rhbz#1277356

This breaks out the backport to it's own commit and adds logging if the new retries pass their limits.

@smarterclayton

Copy link
Copy Markdown
Contributor

Is this targeted for 3.1? @ncdc @pweil-

@ashcrow

ashcrow commented Nov 6, 2015

Copy link
Copy Markdown
Member Author

@smarterclayton yes.

@liggitt liggitt added this to the 1.1.0 milestone Nov 6, 2015
@smarterclayton

Copy link
Copy Markdown
Contributor

I need risk assessment and sign off from both @ncdc and @pweil-, make your case here

@smarterclayton

Copy link
Copy Markdown
Contributor

Just at a glance this looks very high risk.

@smarterclayton

Copy link
Copy Markdown
Contributor

@liggitt can you also do an independent risk assessment here?

@smarterclayton

Copy link
Copy Markdown
Contributor

The last commit needs to be in UPSTREAM: docker/distribution #: message form since it's a PR that changes godeps.

@smarterclayton

Copy link
Copy Markdown
Contributor

Actually all three commits need to be in that form

@smarterclayton

Copy link
Copy Markdown
Contributor

Has there been any discussion upstream about this issue and whether they would accept the proposed fix?

@soltysh

soltysh commented Nov 6, 2015

Copy link
Copy Markdown
Contributor

@smarterclayton there are just 2 commits, 1 is the cherry pick form 1149 and 2nd is the fix, I've already spoke with @ashcrow about it, he's working on it.

@smarterclayton

Copy link
Copy Markdown
Contributor

There are three commits in this PR, but if you are going to fix all of them, that's fine.

@ashcrow
ashcrow force-pushed the fixed-push-to-scaled-registry-with-nfs branch from 1a793ad to c8be144 Compare November 6, 2015 17:34
@soltysh

soltysh commented Nov 6, 2015

Copy link
Copy Markdown
Contributor

I've looked into this PR, it looks safe, imho. Definitely this needs to go upstream, but I bet the 50 retries (that bothers me all the time) isn't going to be accepted. Besides from my investigation this changed quite a bit upstream. Most of these pieces were moved to be driver dependent.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is concerning... I assume we move the file successfully, then get a PathNotFoundError attempting to verify the destination file? If we get that error, it seems unsafe to call moveLayer again. Wouldn't that be likely to fail with a different error (or worse, a different PathNotFoundError since it can't find the source file, if we already moved it)?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check for a source is performed before a move itself and returns PathNotFoundError is it doesn't exist. The method doesn't permorm any post move verification.

@ashcrow

ashcrow commented Nov 6, 2015

Copy link
Copy Markdown
Member Author

Just to be clear about c8be144, it's a backport that isn't just a cherry-pick. It was implementing the defer at the same point in the older code (since it's been restructured in 2.1.x.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is also concerning... if our sizes don't match, we silently update to an expected offset? this seems likely to cause corruption

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was also concerned by that, but looking more I'm thinking its using the offset you set after preforming previous operation. So that's your internal state, iiuc.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resumeHashAt loads stored hash state with the highest offset lower than or equal to the given one. If the stored one is smaller, the gap will be recomputed from file's content. And since it's our instance which wrote the data up to the offset, it should be safe to read it with the same file handle.

@smarterclayton

Copy link
Copy Markdown
Contributor

Anything that changes Godeps must be in the form UPSTREAM: : etc. Otherwise, we have no way of knowing whether it is already fixed when we rebase. You can use <drop> but only if you are 100% positive the next rebase will be at that version or later

@pweil-

pweil- commented Nov 6, 2015

Copy link
Copy Markdown

I need risk assessment and sign off from both @ncdc and @pweil-, make your case here

IMO some of the items that @liggitt is pointing out makes this a high risk item unless we can safely determine that they are not issues.

The impact is also high; we should expect pushes to fail for HA registries that are using NFS storage.

@pweil-

pweil- commented Nov 6, 2015

Copy link
Copy Markdown

The more I think about this the more I'd rather say that there is a bug with HA+NFS rather than risk missing something here and causing more issues with all registries. This also seems like it should have in-depth QE testing and be accepted upstream

@ashcrow

ashcrow commented Nov 6, 2015

Copy link
Copy Markdown
Member Author

@pweil- I think that would be the safest option as long as it's deemed OK.

cc @miminar

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

== ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nvm

@smarterclayton

Copy link
Copy Markdown
Contributor

Are we positive that this is not a tuning issue with NFS? Why does NFS take 5 minutes to report the stat to other filesystems?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, because this is deferred, the response will be sent before the flush happens.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, this needs to go before w.WriteHeader(http.StatusAccepted) line without defer.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and handle any returned error instead of ignoring?

@ncdc

ncdc commented Nov 6, 2015

Copy link
Copy Markdown
Contributor

I'm not comfortable green lighting this without further investigation, discussion with NFS experts, and QE.

@ncdc

ncdc commented Nov 6, 2015

Copy link
Copy Markdown
Contributor

I would also really like to get to the bottom of why we don't see any issues with Docker 1.7, but we do with 1.8. Might be worth talking to @vbatts or @runcom.

@smarterclayton

Copy link
Copy Markdown
Contributor

Can you guys get an initial assessment by 4pm EST?

On Fri, Nov 6, 2015 at 1:45 PM, Andy Goldstein [email protected]
wrote:

I would also really like to get to the bottom of why we don't see any
issues with Docker 1.7, but we do with 1.8. Might be worth talking to
@vbatts https://github.com/vbatts or @runcom https://github.com/runcom
.

—
Reply to this email directly or view it on GitHub
#5761 (comment).

@mrunalp

mrunalp commented Nov 6, 2015

Copy link
Copy Markdown
Member

I think we need some nfs guys to chime in here.

@ncdc

ncdc commented Nov 6, 2015

Copy link
Copy Markdown
Contributor

It's still extremely strange to me that Docker 1.7 doesn't exhibit any issues.

@ncdc

ncdc commented Nov 6, 2015

Copy link
Copy Markdown
Contributor

@smarterclayton Steve is afk for a bit and I don't have an env setup locally to test. I can try to get one up and running but it may eat up the better part of an hour or so... I'm going to look at the registry code to see if there's anything different about the PATCH code path (Docker 1.8 issues PATCH to the registry, 1.7 uses either PUT or POST (I can't remember which offhand)) that would cause this.

@ashcrow

ashcrow commented Nov 6, 2015

Copy link
Copy Markdown
Member Author

@smarterclayton I can't say for certain. There is always a possibility that there is a configuration combination other than those in our docs that would make it much faster.

In terms of the timing, I believe the test setup was a laptop with VM's which would likely be much slower than the power QE usually tests with. And the max attempt should be ~5.3 seconds before it gives up.

I still agree with @pweil- and @ncdc. It's safer to note there is a bug with HA+NFS than to pull this in without full QE and an NFS expert to review.

Michal Minar and others added 2 commits November 6, 2015 15:55
…ry on NFS

On NFS it takes some time for filesystem changes to propagate to other
instances. Several operations need to be retried until successful.

Signed-off-by: Michal Minar <[email protected]>
@ashcrow
ashcrow force-pushed the fixed-push-to-scaled-registry-with-nfs branch from c8be144 to 61950d1 Compare November 6, 2015 20:57
@ncdc

ncdc commented Nov 6, 2015

Copy link
Copy Markdown
Contributor

I don't believe this is a 1.7 vs 1.8 issue. 1.7 fails for me too, although with a different error (BLOB_UPLOAD_UNKNOWN).

@smarterclayton

Copy link
Copy Markdown
Contributor

Decision at this point is to defer but let's continue to follow up and determine whether this is tuning, NFS "wad", or not. make sure this is in the release notes as well as the session affinity workaround - and let's open an issue to have the docker registry service created with source ip session affinity on for 1.1.1

@miminar

miminar commented Nov 16, 2015

Copy link
Copy Markdown

@ashcrow I believe this is now obsoleted by docs PR#1174 and may be closed. Also we'd better tune NFS mount options to mitigate NFS sync issues as suggested in bz#1277356. The question is how to do it with persistent volumes which doesn't take mount options.

@ashcrow ashcrow closed this Nov 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants