From 3632b0bdb326b71a762740f84a3d08ef3a99e26b Mon Sep 17 00:00:00 2001 From: Pavel Kovalenko Date: Wed, 9 Sep 2020 02:35:57 +0300 Subject: [PATCH] Add option to DiskS3 that allows it's usage if S3 unavailable (#14497) --- src/Disks/S3/registerDiskS3.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Disks/S3/registerDiskS3.cpp b/src/Disks/S3/registerDiskS3.cpp index 341ada59631..fbd19ce1cd9 100644 --- a/src/Disks/S3/registerDiskS3.cpp +++ b/src/Disks/S3/registerDiskS3.cpp @@ -145,9 +145,12 @@ void registerDiskS3(DiskFactory & factory) config.getUInt64(config_prefix + ".min_bytes_for_seek", 1024 * 1024)); /// This code is used only to check access to the corresponding disk. - checkWriteAccess(*s3disk); - checkReadAccess(name, *s3disk); - checkRemoveAccess(*s3disk); + if (!config.getBool(config_prefix + ".skip_access_check", false)) + { + checkWriteAccess(*s3disk); + checkReadAccess(name, *s3disk); + checkRemoveAccess(*s3disk); + } bool cache_enabled = config.getBool(config_prefix + ".cache_enabled", true);