Skip to content

Volume command doesn't retry on conflicts #4351

Closed

Description

@liggitt

oc volume dc/test-deployment-config --remove --confirm

error: deploymentConfig "test-deployment-config" cannot be updated: the object has been modified; please apply your changes to the latest version and try again
!!! Error in test/cmd/volumes.sh:29
  '[ "$(oc volume dc/test-deployment-config --remove --confirm)" ]' exited with status 1
Call stack:
  1: test/cmd/volumes.sh:29 main(...)
Exiting with status 1
!!! Error in hack/test-cmd.sh:269
  '${test}' exited with status 1
Call stack:
  1: hack/test-cmd.sh:269 main(...)

https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/4461/console

Activity

  1. added
    kind/bug
    kind/test-flake
    on Aug 25, 2015
  2. changed the title [-]Flake in `oc volume dc/test-deployment-config --remove --confirm`[/-] [+]Volume command doesn't retry on conflicts[/+] on Aug 25, 2015
  3. liggitt commented on Aug 25, 2015

    @liggitt
    ContributorAuthor

    Not sure if it should retry, but failure is making cmd tests flake

  4. liggitt commented on Aug 25, 2015

    @liggitt
    ContributorAuthor

    I think most commands that don't take a resourceVersion as input, and that fetch and immediately update, should retry at least once if they get a conflict. If the user didn't provide a resourceVersion as input, then they are requesting a bounded mutation which the command should attempt to fulfil.

    This is especially important on resources that get modified by controller loops (deployment configs, replication controllers, pods, etc).

    Example commands (when not provided a resourceVersion as input):

    oc label
    oc annotate
    oc volume
    oc scale?
    oc env?
    oc start-build?
    oc deploy?
    
  5. smarterclayton commented on Aug 28, 2015

    @smarterclayton
    Contributor

    I thought we opened an upstream issue for this

  6. smarterclayton commented on Aug 28, 2015

    @smarterclayton
    Contributor

    Things we can check

    • generation
    • spec differences
    • metadata differences
      • knowing what metadata we changed

    A generalized pattern would be better than a specific one.

  7. smarterclayton commented on Oct 27, 2015

    @smarterclayton
    Contributor

    I'm wondering if we should now be using Patch on the server for this.

  8. liggitt commented on Nov 3, 2015

    @liggitt
    ContributorAuthor

    https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/6679/console

    error: deploymentConfig "test-deployment-config" cannot be updated: the object has been modified; please apply your changes to the latest version and try again
    !!! Error in test/cmd/volumes.sh:17
        '[ "$(oc volume dc/test-deployment-config --add --name=vol2 --type=emptydir -m /opt)" ]' exited with status 1
    Call stack:
        1: test/cmd/volumes.sh:17 main(...)
    
  9. added this to the 1.1.x milestone on Nov 3, 2015
  10. smarterclayton commented on Nov 3, 2015

    @smarterclayton
    Contributor

    Post 1.1

  11. childsb commented on Feb 4, 2016

    @childsb
    Contributor

    Does this problem still exist?

  12. 6 remaining items

  13. smarterclayton commented on Jun 30, 2016

    @smarterclayton
    Contributor

    It is indeed

    On Jun 30, 2016, at 6:02 AM, Ben Parees [email protected] wrote:

    not sure if this is the same issue or not, but:

    === BEGIN TEST CASE ===
    test/cmd/volumes.sh:48: executing 'oc set volume
    dc/test-deployment-config --add --mount-path=/second --type=pvc
    --claim-size=1G --claim-mode=rwo' expecting success
    FAILURE after 0.759s: test/cmd/volumes.sh:48: executing 'oc set volume
    dc/test-deployment-config --add --mount-path=/second --type=pvc
    --claim-size=1G --claim-mode=rwo' expecting success: the command
    returned the wrong error code
    Standard output from the command:
    persistentvolumeclaims/pvc-ilqx4

    Standard error from the command:
    info: Generated volume name: volume-l6n9f
    error: Operation cannot be fulfilled on deploymentconfigs
    "test-deployment-config": the object has been modified; please apply
    your changes to the latest version and try again
    === END TEST CASE ===

    as seen in:
    https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_check/2669/console

    —
    You are receiving this because you commented.
    Reply to this email directly, view it on GitHub
    #4351 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe/ABG_p28W0QmIbDPngcVdN78xuC-I8NV_ks5qQ75bgaJpZM4FxdH7
    .

  14. deads2k commented on Jun 30, 2016

    @deads2k
    Contributor

    I thought we opened an upstream issue for this

    We switched the most common offenders to use patch which allowed them to automatically reapply non-conflicting changes. A blind retryOnConflict can cause concurrent conflicting changes to unconditionally stomp each other which seems less than desirable.

  15. modified the milestones: 1.2.x, 1.3.0 on Jul 12, 2016
  16. modified the milestones: 1.3.0, 1.4.0 on Sep 1, 2016
  17. gnufied commented on Sep 20, 2016

    @gnufied
    Member

    I emailed @liggitt about this, but one potential problem I have been grappling with is - this command can't be entirely moved to use PATCH because it allows user to create volume claims when adding volumes to Deploymentconfig etcetra.

    So I am thinking, this has to be done in two steps:

    1. if request includes adding volume claims - it will still do the usual POST
    2. For all other cases it will do PATCH.

    Does it make sense? @smarterclayton @childsb

  18. smarterclayton commented on Sep 21, 2016

    @smarterclayton
    Contributor

    It's ok to create claims first with a post then apply a patch in a consistent code for changing the template. After all, we don't support atomic operations anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/testscomponent/storagekind/bugkind/test-flakepriority/P2

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions