MCOL-5352 Properly handle PP restart for DML/DDL operations.

This commit is contained in:
Denis Khalikov
2024-02-01 13:27:01 +00:00
committed by Leonid Fedorov
parent d3896efb0f
commit 7f14dae5c7
31 changed files with 726 additions and 401 deletions

View File

@ -541,6 +541,25 @@ int PackageHandler::clearTableAccess()
return 1;
}
CalpontSystemCatalog::ROPair PackageHandler::getTableRID(
boost::shared_ptr<execplan::CalpontSystemCatalog> fcsc,
execplan::CalpontSystemCatalog::TableName& tableName)
{
execplan::CalpontSystemCatalog::ROPair roPair;
try
{
roPair = fcsc->tableRID(tableName);
}
catch (...)
{
if (setupDec())
throw;
roPair = fcsc->tableRID(tableName);
}
return roPair;
}
void PackageHandler::run()
{
ResourceManager* frm = ResourceManager::instance();
@ -577,7 +596,7 @@ void PackageHandler::run()
CalpontSystemCatalog::TableName tableName;
tableName.schema = insertPkg.get_Table()->get_SchemaName();
tableName.table = insertPkg.get_Table()->get_TableName();
CalpontSystemCatalog::ROPair roPair = fcsc->tableRID(tableName);
CalpontSystemCatalog::ROPair roPair = getTableRID(fcsc, tableName);
fTableOid = roPair.objnum;
}
synchTable.setPackage(this, &insertPkg); // Blocks if another DML thread is using this fTableOid
@ -976,7 +995,7 @@ void PackageHandler::run()
CalpontSystemCatalog::TableName tableName;
tableName.schema = updatePkg->get_Table()->get_SchemaName();
tableName.table = updatePkg->get_Table()->get_TableName();
CalpontSystemCatalog::ROPair roPair = fcsc->tableRID(tableName);
CalpontSystemCatalog::ROPair roPair = getTableRID(fcsc, tableName);
fTableOid = roPair.objnum;
}
synchTable.setPackage(this,
@ -1036,7 +1055,7 @@ void PackageHandler::run()
CalpontSystemCatalog::TableName tableName;
tableName.schema = deletePkg->get_Table()->get_SchemaName();
tableName.table = deletePkg->get_Table()->get_TableName();
CalpontSystemCatalog::ROPair roPair = fcsc->tableRID(tableName);
CalpontSystemCatalog::ROPair roPair = getTableRID(fcsc, tableName);
fTableOid = roPair.objnum;
}
synchTable.setPackage(this,