Skip to content

S3 storage class workaround for minio #1148

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

Merged
merged 2 commits into from
Jan 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion ydb/core/wrappers/s3_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,18 @@ class TPutInputStreamContext: public TInputStreamContext<TEvRequest, TEvResponse

const typename TBase::TRequest& PrepareRequest(typename TEvRequest::TPtr& ev) override {
auto& request = ev->Get()->MutableRequest();
request.WithStorageClass(TBase::StorageClass);
auto storageClass = TBase::StorageClass;

// workaround for minio.
// aws s3 treats NOT_SET as STANDARD
// but internally sdk just doesn't set corresponding header, while adds it to SignedHeaders
// and minio implementation treats it as error, returning to client error
// which literally can't be debugged e.g. "There were headers present in the request which were not signed"
if (storageClass == Aws::S3::Model::StorageClass::NOT_SET) {
storageClass = Aws::S3::Model::StorageClass::STANDARD;
}

request.WithStorageClass(storageClass);
return TBase::PrepareRequest(ev);
}
}; // TPutInputStreamContext
Expand Down