Support bucket versioning (#9377)

- Implement a new xl.json 2.0.0 format to support,
  this moves the entire marshaling logic to POSIX
  layer, top layer always consumes a common FileInfo
  construct which simplifies the metadata reads.
- Implement list object versions
- Migrate to siphash from crchash for new deployments
  for object placements.

Fixes #2111
This commit is contained in:
Harshavardhana
2020-06-12 20:04:01 -07:00
committed by GitHub
parent 43d6e3ae06
commit 4915433bd2
203 changed files with 13833 additions and 6919 deletions

View File

@@ -82,11 +82,11 @@ func dirObjectInfo(bucket, object string, size int64, metadata map[string]string
// Depending on the disk type network or local, initialize storage API.
func newStorageAPI(endpoint Endpoint) (storage StorageAPI, err error) {
if endpoint.IsLocal {
storage, err := newPosix(endpoint.Path, endpoint.Host)
storage, err := newXLStorage(endpoint.Path, endpoint.Host)
if err != nil {
return nil, err
}
return &posixDiskIDCheck{storage: storage}, nil
return &xlStorageDiskIDCheck{storage: storage}, nil
}
return newStorageRESTClient(endpoint), nil
@@ -105,7 +105,7 @@ func cleanupDir(ctx context.Context, storage StorageAPI, volume, dirPath string)
}
// If it's a directory, list and call delFunc() for each entry.
entries, err := storage.ListDir(volume, entryPath, -1, "")
entries, err := storage.ListDir(volume, entryPath, -1)
// If entryPath prefix never existed, safe to ignore.
if err == errFileNotFound {
return nil
@@ -165,7 +165,7 @@ func listObjectsNonSlash(ctx context.Context, bucket, prefix, marker, delimiter
// ignore quorum error as it might be an entry from an outdated disk.
if IsErrIgnored(err, []error{
errFileNotFound,
errXLReadQuorum,
errErasureReadQuorum,
}...) {
continue
}
@@ -358,7 +358,7 @@ func listObjects(ctx context.Context, obj ObjectLayer, bucket, prefix, marker, d
// ignore quorum error as it might be an entry from an outdated disk.
if IsErrIgnored(err, []error{
errFileNotFound,
errXLReadQuorum,
errErasureReadQuorum,
}...) {
continue
}