Project

General

Profile

Actions

Feature #8562

closed

rgw: Conditional PUT on ETag

Added by Xiangyu Lv almost 12 years ago. Updated over 11 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Community (dev)
Backport:
Reviewed:
Affected Versions:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

The object versioning has not been implemented yet in RGW. But there are some use cases that different sources concurrently write to the same item. It introduces lost update issue without object versioning.

Anouther simpler approach for preventing lost updates is the Conditional PUT on ETag and retrying on client side. The behavior conforms to HTTP standard If-Match and If-None-Match

  • If-Match: <ETag>, If the entity tag matches the entity tag of the entity that would have been returned in the response to a similar GET request (without the If-Match header) on that resource.
  • If-Match: *, The PUT will succeed if the resource exists; otherwise, it will fail.
  • If-None-Match: <ETag>, If the entity tag does not match the entity tag of the entity that would have been returned in the response to a similar GET request (without the If-None-Match header) on that resource.
  • If-None-Match: *, The PUT will succeed if the resource does not exist; otherwise, it will fail.
Actions #1

Updated by Xiangyu Lv over 11 years ago

  • Assignee set to Xiangyu Lv
Actions #2

Updated by Xiangyu Lv over 11 years ago

Here is a PR for discussion purpose: https://github.com/ceph/ceph/pull/2755
We may need to elaborate a bit on it after the solution is clear.

Actions #3

Updated by Xiangyu Lv over 11 years ago

Closed the previous out-of-synced PR and submitted a new one: https://github.com/ceph/ceph/pull/2756

Actions #4

Updated by Xiangyu Lv over 11 years ago

  • Status changed from New to Fix Under Review
Actions #5

Updated by Yehuda Sadeh over 11 years ago

  • Status changed from Fix Under Review to Resolved

Merged, commit:7925b82c20c94043dd5e4ca69d3ef55ea43db1e0.
Tests commit:3e1e2ee43893264eb9ca2a3fbc581ebe46c06d0e

Actions

Also available in: Atom PDF