add logs for resource to disk mapping

This commit is contained in:
serxa 2024-09-24 16:47:54 +00:00
parent 9db958dcdc
commit d57c28aa52

View File

@ -104,11 +104,21 @@ DiskObjectStorage::DiskObjectStorage(
{
case ASTCreateResourceQuery::AccessMode::Read:
{
if (read_resource_name_from_config.empty())
LOG_INFO(log, "Using resource '{}' for READ", resource_name);
else
LOG_INFO(log, "Resource '{}' should be used for READ, but it is overriden by config to resource '{}'",
resource_name, read_resource_name_from_config);
read_resource_name_from_sql = resource_name;
break;
}
case ASTCreateResourceQuery::AccessMode::Write:
{
if (write_resource_name_from_config.empty())
LOG_INFO(log, "Using resource '{}' for WRITE", resource_name);
else
LOG_INFO(log, "Resource '{}' should be used for WRITE, but it is overriden by config to resource '{}'",
resource_name, write_resource_name_from_config);
write_resource_name_from_sql = resource_name;
break;
}
@ -119,9 +129,15 @@ DiskObjectStorage::DiskObjectStorage(
else // DROP RESOURCE
{
if (read_resource_name_from_sql == resource_name)
{
LOG_INFO(log, "Stop using resource '{}' for READ", resource_name);
read_resource_name_from_sql.clear();
}
if (write_resource_name_from_sql == resource_name)
{
LOG_INFO(log, "Stop using resource '{}' for WRITE", resource_name);
write_resource_name_from_sql.clear();
}
}
break;
}