From 0c9f4c909206aa05bf1dd72b45979f56b173872e Mon Sep 17 00:00:00 2001 From: Krishna Srinivas <634494+krishnasrinivas@users.noreply.github.com> Date: Mon, 16 Jul 2018 20:26:42 -0700 Subject: [PATCH] formatMetaV1 should be "inherited" by disk format structs (#6134) --- cmd/format-xl.go | 12 ++++++------ cmd/format-xl_test.go | 18 ++++++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/cmd/format-xl.go b/cmd/format-xl.go index 44cb3fe26..d3f44e1ba 100644 --- a/cmd/format-xl.go +++ b/cmd/format-xl.go @@ -86,10 +86,11 @@ type formatXLV1 struct { // Represents the V2 backend disk structure version // under `.minio.sys` and actual data namespace. // formatXLV2 - structure holds format config version '2'. +// The V2 format to support "large bucket" support where a bucket +// can span multiple erasure sets. type formatXLV2 struct { - Version string `json:"version"` - Format string `json:"format"` - XL struct { + formatMetaV1 + XL struct { Version string `json:"version"` // Version of 'xl' format. This string `json:"this"` // This field carries assigned disk uuid. // Sets field carries the input disk order generated the first @@ -107,9 +108,8 @@ type formatXLV2 struct { // In .minio.sys/multipart we have: // sha256(bucket/object)/uploadID/[xl.json, part.1, part.2 ....] type formatXLV3 struct { - Version string `json:"version"` - Format string `json:"format"` - XL struct { + formatMetaV1 + XL struct { Version string `json:"version"` // Version of 'xl' format. This string `json:"this"` // This field carries assigned disk uuid. // Sets field carries the input disk order generated the first diff --git a/cmd/format-xl_test.go b/cmd/format-xl_test.go index 6084d097f..ac19eb7b2 100644 --- a/cmd/format-xl_test.go +++ b/cmd/format-xl_test.go @@ -345,8 +345,10 @@ func TestCheckFormatXLValue(t *testing.T) { // Invalid XL format version "2". { &formatXLV3{ - Version: "2", - Format: "XL", + formatMetaV1: formatMetaV1{ + Version: "2", + Format: "XL", + }, XL: struct { Version string `json:"version"` This string `json:"this"` @@ -361,8 +363,10 @@ func TestCheckFormatXLValue(t *testing.T) { // Invalid XL format "Unknown". { &formatXLV3{ - Version: "1", - Format: "Unknown", + formatMetaV1: formatMetaV1{ + Version: "1", + Format: "Unknown", + }, XL: struct { Version string `json:"version"` This string `json:"this"` @@ -377,8 +381,10 @@ func TestCheckFormatXLValue(t *testing.T) { // Invalid XL format version "0". { &formatXLV3{ - Version: "1", - Format: "XL", + formatMetaV1: formatMetaV1{ + Version: "1", + Format: "XL", + }, XL: struct { Version string `json:"version"` This string `json:"this"`