Repository navigation
Adds new StorageDriver.FileWriter interface - #1438
Conversation
f6a308b to
c5be337
Compare
|
@docker/distribution-maintainers I think the changes to registry/storage are ready for review before finishing up with the Swift/GCS/Rados drivers |
|
This is a bit difficult to review in the current state because of the huge vendoring commit. Github can't display the diff because it's too big. I commented on the actual commit earlier, but the comment seems to have been lost after a rebase. If #1385 is ready to merge, merging it would make things easier here. |
|
Very understandable. I believe #1385 is ready to go... |
|
Unfortunately that one isn't easy to review either |
|
LGTM on the interface changes except for the |
1f3d6e2 to
309ef74
Compare
309ef74 to
0c5e0fc
Compare
|
This is going to be sort of a challenge to merge without temporarily disabling some of the community drivers. I don't have a reasonable test environment for swift, rados, or oss. @lebauce / @nevermosby could either of you update the swift driver to the new specification and make a PR to my fork? @gierschv could you help update the rados driver? @denverdino / @liuchang0812 could you help with the OSS driver? |
|
@BrianBland , Sure, I will change the OSS driver |
|
@BrianBland , the PR of Support FileWriter interface for OSS storage driver is submitted. |
Change-Id: Ie5533ad85f944800499ca1040fd67bf1378815e0 Signed-off-by: Li Yi <[email protected]>
Signed-off-by: Brian Bland <[email protected]>
7272510 to
7fd1db9
Compare
|
As part of this refactor, I've decided to remove the rados driver in favor of the updated Swift driver. Anyone who wishes to use the registry with Ceph as the underlying storage backend should use the Ceph Object Gateway. I've successfully tested this with the Swift driver using a configuration such as: swift:
authurl: http://192.168.33.10:7480/auth/v1
username: "testuser:swift"
password: "mypassword"
container: testingIt's possible that this also works correctly with the S3 driver thanks to #1512, but v4 auth support was only just merged into Ceph as of ceph/ceph#4943 (26 days ago), so it's doubtful that production deployments currently support this, and the stability is as of yet unverified. |
f378028 to
4a2f207
Compare
4a2f207 to
0b89ccf
Compare
Signed-off-by: Brian Bland <[email protected]>
0b89ccf to
5967d33
Compare
Current coverage is
|
|
LGTM on interface and handler changes |
|
LGTM @BrianBland I'm not sure what to do on the |
|
@stevvooe with some judicious documentation, I don't think the ceph driver will be missed. Any ceph user can put the swift gateway in front of their cluster and use the swift driver (and soon the s3 driver). In fact, Swift supports the S3 API, so we could conceivably rid ourselves of that driver too 😹 |
|
LGTM. This is great in a number of ways 👏 👏 👏 |
Adds new StorageDriver.FileWriter interface
|
👍 |
See distribution#2077 for background. The PR distribution#1438 which was not reviewed by azure folks basically introduced a race condition around uploads to the same blob by multiple clients concurrently as it used the "writer" type for PutContent(), introduced in distribution#1438. This does chunked upload of blobs using "AppendBlob" type, which was not atomic. Usage of "writer" type and thus AppendBlobs on metadata files is currently not concurrency-safe and generally, they are not the right type of blob for the job. This patch fixes PutContent() to use the atomic upload operation that works for uploads smaller than 64 MB and creates blobs with "BlockBlob" type. To be backwards compatible, we query the type of the blob first and if it is not a "BlockBlob" we delete the blob first before doing an atomic PUT. This creates a small inconsistency/race window "only once". Once the blob is made "BlockBlob", it is overwritten with a single PUT atomicallly next time. Therefore, going forward, PutContent() will be producing BlockBlobs and it will silently migrate the AppendBlobs introduced in distribution#1438 to BlockBlobs with this patch. Tested with existing code side by side, both registries with and without this patch work fine without breaking each other. So this should be good from a backwards/forward compatiblity perspective, with a cost of doing an extra HEAD checking the blob type. Fixes distribution#2077. Signed-off-by: Ahmet Alp Balkan <[email protected]>
…Writer Adds new StorageDriver.FileWriter interface
…Writer Adds new StorageDriver.FileWriter interface
Implements new StorageDriver.FileWriter interface as defined in #1395
Currently works for the following drivers: