Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Single drive XL implementation #14970

Merged
merged 1 commit into from May 30, 2022

Conversation

harshavardhana
Copy link
Member

Description

feat: Single drive XL implementation

Motivation and Context

The main motivation is to move toward a common backend format
for all different types of modes in MinIO, allowing for
a simpler code and predictable behavior across all features.

This PR also brings features such as versioning, replication,
transitioning to single drive setups.

How to test this PR?

All tests should cover this

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Fixes a regression (If yes, please add commit-id or PR # here)
  • Documentation updated
  • Unit tests added/updated

@klauspost
Copy link
Contributor

I was really hoping this could be done without the massive code duplication, so we didn't have to update much of the code twice when updating.

@harshavardhana
Copy link
Member Author

harshavardhana commented May 25, 2022

I was really hoping this could be done without the massive code duplication, so we didn't have to update much of the code twice when updating.

It is very hard to do that in the first iteration alone - @klauspost there were a lot of assumptions that need to be cleaned up. Priority was to get this out first, once that is done we can slowly work towards merging the code and cleanups.

I did not want to introduce regressions in regular code with this new change.

@harshavardhana harshavardhana force-pushed the single-drive branch 2 times, most recently from 48c881f to 04c39a0 Compare May 26, 2022 01:33
@ravindk89

This comment was marked as resolved.

@harshavardhana harshavardhana force-pushed the single-drive branch 2 times, most recently from fb509f9 to 571509a Compare May 26, 2022 17:14
@klauspost
Copy link
Contributor

Error:

Error: metacache.delete: expected objAPI to be *erasureServerPools (*errors.errorString)
       3: d:\minio\minio\internal\logger\logger.go:278:logger.LogIf()
       2: d:\minio\minio\cmd\metacache.go:160:cmd.(*metacache).delete()
       1: d:\minio\minio\cmd\metacache-manager.go:83:cmd.(*metacacheManager).initManager.func1()

Add:

func (es *erasureSingle) renameAll(ctx context.Context, bucket, prefix string) {
	if es.disk != nil {
		es.disk.RenameFile(ctx, bucket, prefix, minioMetaTmpDeletedBucket, mustGetUUID())
	}
}

type renameAllStorager interface {
	renameAll(ctx context.Context, bucket, prefix string)
}

In *metacache.delete, newBucketMetacache, *bucketMetacache.deleteAll

replace

	ez, ok := newObjectLayerFn().(*erasureServerPools)
	if !ok {
		logger.LogIf(ctx, errors.New("bucketMetacache: expected objAPI to be *erasurePools"))
		return
	}

with

	ez, ok := newObjectLayerFn().(renameAllStorager)
	if !ok {
		logger.LogIf(ctx, errors.New("bucketMetacache: expected objAPI to be renameAllStorager"))
		return
	}

Main motivation is move towards a common backend format
for all different types of modes in MinIO, allowing for
a simpler code and predictable behavior across all features.

This PR also brings features such as versioning, replication,
transitioning to single drive setups.
@harshavardhana
Copy link
Member Author

Error:

Error: metacache.delete: expected objAPI to be *erasureServerPools (*errors.errorString)
       3: d:\minio\minio\internal\logger\logger.go:278:logger.LogIf()
       2: d:\minio\minio\cmd\metacache.go:160:cmd.(*metacache).delete()
       1: d:\minio\minio\cmd\metacache-manager.go:83:cmd.(*metacacheManager).initManager.func1()

Add:

func (es *erasureSingle) renameAll(ctx context.Context, bucket, prefix string) {
	if es.disk != nil {
		es.disk.RenameFile(ctx, bucket, prefix, minioMetaTmpDeletedBucket, mustGetUUID())
	}
}

type renameAllStorager interface {
	renameAll(ctx context.Context, bucket, prefix string)
}

In *metacache.delete, newBucketMetacache, *bucketMetacache.deleteAll

replace

	ez, ok := newObjectLayerFn().(*erasureServerPools)
	if !ok {
		logger.LogIf(ctx, errors.New("bucketMetacache: expected objAPI to be *erasurePools"))
		return
	}

with

	ez, ok := newObjectLayerFn().(renameAllStorager)
	if !ok {
		logger.LogIf(ctx, errors.New("bucketMetacache: expected objAPI to be renameAllStorager"))
		return
	}

Found couple of more places @klauspost fixed them - thanks.

@minio-trusted
Copy link
Contributor

Mint Automation

Test Result
mint-large-bucket.sh ✔️
mint-fs.sh ✔️
mint-gateway-s3.sh ✔️
mint-erasure.sh ✔️
mint-dist-erasure.sh ✔️
mint-pools.sh ✔️
mint-compress-encrypt-dist-erasure.sh more...

14970-781952c/mint-compress-encrypt-dist-erasure.sh.log:

Running with
SERVER_ENDPOINT:      minio-k8s2:31744
ACCESS_KEY:           minio
SECRET_KEY:           ***REDACTED***
ENABLE_HTTPS:         0
SERVER_REGION:        us-east-1
MINT_DATA_DIR:        /mint/data
MINT_MODE:            full
ENABLE_VIRTUAL_STYLE: 0
RUN_ON_FAIL:          0

To get logs, run 'docker cp :/mint/log /tmp/mint-logs'

(1/15) Running aws-sdk-go tests ... done in 1 seconds
(2/15) Running aws-sdk-java tests ... done in 1 seconds
(3/15) Running aws-sdk-php tests ... done in 43 seconds
(4/15) Running aws-sdk-ruby tests ... done in 6 seconds
(5/15) Running awscli tests ... FAILED in 1 minutes and 19 seconds
{
  "name": "awscli",
  "duration": 33116,
  "function": "aws --endpoint-url http://minio-k8s2:31744 s3 sync --no-progress /mint/data s3://awscli-mint-test-bucket-7142/\n",
  "status": "FAIL",
  "error": "upload: ../../../data/datafile-0-b to s3://awscli-mint-test-bucket-7142/datafile-0-bupload: ../../../data/datafile-1-b to s3://awscli-mint-test-bucket-7142/datafile-1-bupload: ../../../data/datafile-1-kB to s3://awscli-mint-test-bucket-7142/datafile-1-kBupload: ../../../data/datafile-10-kB to s3://awscli-mint-test-bucket-7142/datafile-10-kBupload: ../../../data/datafile-33-kB to s3://awscli-mint-test-bucket-7142/datafile-33-kBupload: ../../../data/datafile-100-kB to s3://awscli-mint-test-bucket-7142/datafile-100-kBupload: ../../../data/datafile-1-MB to s3://awscli-mint-test-bucket-7142/datafile-1-MBupload: ../../../data/datafile-1.03-MB to s3://awscli-mint-test-bucket-7142/datafile-1.03-MBupload: ../../../data/datafile-5243880-b to s3://awscli-mint-test-bucket-7142/datafile-5243880-bupload: ../../../data/datafile-5-MB to s3://awscli-mint-test-bucket-7142/datafile-5-MBupload: ../../../data/datafile-11-MB to s3://awscli-mint-test-bucket-7142/datafile-11-MBupload: ../../../data/datafile-6-MB to s3://awscli-mint-test-bucket-7142/datafile-6-MBupload: ../../../data/datafile-65-MB to s3://awscli-mint-test-bucket-7142/datafile-65-MBupload: ../../../data/datafile-129-MB to s3://awscli-mint-test-bucket-7142/datafile-129-MBupload failed: ../../../data/datafile-10-MB to s3://awscli-mint-test-bucket-7142/datafile-10-MB 'ETag'"
}
(5/15) Running healthcheck tests ... done in 0 seconds
(6/15) Running mc tests ... done in 28 seconds
(7/15) Running minio-dotnet tests ... done in 6 minutes and 11 seconds
(8/15) Running minio-go tests ... done in 1 minutes and 25 seconds
(9/15) Running minio-java tests ... done in 31 seconds
(10/15) Running minio-js tests ... done in 1 minutes and 4 seconds
(11/15) Running minio-py tests ... done in 1 minutes and 19 seconds
(12/15) Running s3cmd tests ... done in 24 seconds
(13/15) Running s3select tests ... done in 3 seconds
(14/15) Running versioning tests ... done in 3 minutes and 4 seconds

Executed 14 out of 15 tests successfully.

Deleting image on docker hub
Deleting image locally

Copy link
Contributor

@klauspost klauspost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested, so far LGTM.

@harshavardhana harshavardhana merged commit f1abb92 into minio:master May 30, 2022
@harshavardhana harshavardhana deleted the single-drive branch May 30, 2022 17:58
@jbenguira
Copy link

Great new feature thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants