You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
MCOL-4347: Better handling of getConnection() returning NULL from libmarias3 init.
This commit is contained in:
@ -231,6 +231,12 @@ int S3Storage::getObject(const string &_sourceKey, boost::shared_array<uint8_t>
|
|||||||
string sourceKey = prefix + _sourceKey;
|
string sourceKey = prefix + _sourceKey;
|
||||||
|
|
||||||
ms3_st *creds = getConnection();
|
ms3_st *creds = getConnection();
|
||||||
|
if (!creds)
|
||||||
|
{
|
||||||
|
logger->log(LOG_ERR, "S3Storage::getObject(): failed to GET, S3Storage::getConnection() returned NULL on init");
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
ScopedConnection sc(this, creds);
|
ScopedConnection sc(this, creds);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@ -325,6 +331,12 @@ int S3Storage::putObject(const boost::shared_array<uint8_t> data, size_t len, co
|
|||||||
string destKey = prefix + _destKey;
|
string destKey = prefix + _destKey;
|
||||||
uint8_t s3err;
|
uint8_t s3err;
|
||||||
ms3_st *creds = getConnection();
|
ms3_st *creds = getConnection();
|
||||||
|
if (!creds)
|
||||||
|
{
|
||||||
|
logger->log(LOG_ERR, "S3Storage::putObject(): failed to PUT, S3Storage::getConnection() returned NULL on init");
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
ScopedConnection sc(this, creds);
|
ScopedConnection sc(this, creds);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@ -363,6 +375,12 @@ int S3Storage::deleteObject(const string &_key)
|
|||||||
uint8_t s3err;
|
uint8_t s3err;
|
||||||
string key = prefix + _key;
|
string key = prefix + _key;
|
||||||
ms3_st *creds = getConnection();
|
ms3_st *creds = getConnection();
|
||||||
|
if (!creds)
|
||||||
|
{
|
||||||
|
logger->log(LOG_ERR, "S3Storage::deleteObject(): failed to DELETE, S3Storage::getConnection() returned NULL on init");
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
ScopedConnection sc(this, creds);
|
ScopedConnection sc(this, creds);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@ -401,6 +419,12 @@ int S3Storage::copyObject(const string &_sourceKey, const string &_destKey)
|
|||||||
string sourceKey = prefix + _sourceKey, destKey = prefix + _destKey;
|
string sourceKey = prefix + _sourceKey, destKey = prefix + _destKey;
|
||||||
uint8_t s3err;
|
uint8_t s3err;
|
||||||
ms3_st *creds = getConnection();
|
ms3_st *creds = getConnection();
|
||||||
|
if (!creds)
|
||||||
|
{
|
||||||
|
logger->log(LOG_ERR, "S3Storage::copyObject(): failed to copy, S3Storage::getConnection() returned NULL on init");
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
ScopedConnection sc(this, creds);
|
ScopedConnection sc(this, creds);
|
||||||
|
|
||||||
do
|
do
|
||||||
@ -455,6 +479,12 @@ int S3Storage::exists(const string &_key, bool *out)
|
|||||||
uint8_t s3err;
|
uint8_t s3err;
|
||||||
ms3_status_st status;
|
ms3_status_st status;
|
||||||
ms3_st *creds = getConnection();
|
ms3_st *creds = getConnection();
|
||||||
|
if (!creds)
|
||||||
|
{
|
||||||
|
logger->log(LOG_ERR, "S3Storage::exists(): failed to HEAD, S3Storage::getConnection() returned NULL on init");
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
ScopedConnection sc(this, creds);
|
ScopedConnection sc(this, creds);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
Reference in New Issue
Block a user