Adam Litke has posted comments on this change.

Change subject: storage: Increment generation id when completing operation
......................................................................


Patch Set 1:

(3 comments)

https://gerrit.ovirt.org/#/c/64487/1/vdsm/storage/volume.py
File vdsm/storage/volume.py:

Line 510:         the volume is legal we want to call volume.getInfo to 
determine if this
Line 511:         operation has not been started or has finished successfully.  
We enable
Line 512:         this by incrementing the generation id after the operation 
completes.
Line 513:         Note that legality and generation id must be updated in the 
same write
Line 514:         operation.
> The last note is not interesting to the users of this api. It should be rig
Done
Line 515: 
Line 516:         If generation is provided we check that the volume's 
generation matches
Line 517:         """
Line 518:         real_gen_id = self.getMetaParam(sc.GENERATION)


Line 520:             raise se.InvalidGeneration(requested_gen_id, real_gen_id)
Line 521:         self.setLegality(sc.ILLEGAL_VOL)
Line 522:         yield
Line 523: 
Line 524:         # Update the generation id and legality in one write
> Lets replace this with the sentence from the docstring, with a IMPORTANT: p
Done
Line 525:         metadata = self.getMetadata()
Line 526:         metadata[sc.LEGALITY] = sc.LEGAL_VOL
Line 527:         metadata[sc.GENERATION] = real_gen_id + 1
Line 528:         self.setMetadata(metadata)


Line 523: 
Line 524:         # Update the generation id and legality in one write
Line 525:         metadata = self.getMetadata()
Line 526:         metadata[sc.LEGALITY] = sc.LEGAL_VOL
Line 527:         metadata[sc.GENERATION] = real_gen_id + 1
> We need to wrap around, or assert, we cannot use unlimited value:
Done
Line 528:         self.setMetadata(metadata)
Line 529: 
Line 530: 
Line 531: class Volume(object):


-- 
To view, visit https://gerrit.ovirt.org/64487
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic9a62289378b11c3b2f2f520c894336fc89c1fdc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <ali...@redhat.com>
Gerrit-Reviewer: Adam Litke <ali...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org

Reply via email to