Skip to content

Commit fc546c9

Browse files
committed
fix
1 parent 35d875a commit fc546c9

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

src/Storages/ObjectStorage/StorageObjectStorage.cpp

+17-12
Original file line numberDiff line numberDiff line change
@@ -112,26 +112,31 @@ StorageObjectStorage::StorageObjectStorage(
112112
bool failed_init = false;
113113
auto do_init = [&]()
114114
{
115-
if (!lazy_init)
115+
try
116116
{
117117
if (configuration->hasExternalDynamicMetadata())
118118
configuration->updateAndGetCurrentSchema(object_storage, context);
119119
else
120120
configuration->update(object_storage, context);
121121
}
122-
}
123-
catch (...)
124-
{
125-
// If we don't have format or schema yet, we can't ignore failed configuration update, because relevant configuration is crucial for format and schema inference
126-
if (mode <= LoadingStrictnessLevel::CREATE || columns_.empty() || (configuration->format == "auto"))
127-
{
128-
throw;
129-
}
130-
else
122+
catch (...)
131123
{
132-
tryLogCurrentException(log);
124+
// If we don't have format or schema yet, we can't ignore failed configuration update,
125+
// because relevant configuration is crucial for format and schema inference
126+
if (mode <= LoadingStrictnessLevel::CREATE || columns_.empty() || (configuration->format == "auto"))
127+
{
128+
throw;
129+
}
130+
else
131+
{
132+
tryLogCurrentException(log);
133+
failed_init = true;
134+
}
133135
}
134-
}
136+
};
137+
138+
if (!do_lazy_init)
139+
do_init();
135140

136141
std::string sample_path;
137142
ColumnsDescription columns{columns_};

0 commit comments

Comments
 (0)