Skip to content
Snippets Groups Projects
Commit 70295358 authored by Steven Murray's avatar Steven Murray
Browse files

cta/CTA#186 CTA should cope with idle database connections being dropped by the database server

OracleCatalogue::deleteArchiveFile()  should re-connect to database if connection lost.
parent ff34640d
No related branches found
No related tags found
No related merge requests found
......@@ -140,6 +140,15 @@ OracleCatalogue::~OracleCatalogue() {
// deleteArchiveFile
//------------------------------------------------------------------------------
void OracleCatalogue::deleteArchiveFile(const std::string &diskInstanceName, const uint64_t archiveFileId,
log::LogContext &lc) {
return retryOnLostConnection(m_log, [&]{return deleteArchiveFileInternal(diskInstanceName, archiveFileId, lc);},
m_maxTriesToConnect);
}
//------------------------------------------------------------------------------
// deleteArchiveFileInternal
//------------------------------------------------------------------------------
void OracleCatalogue::deleteArchiveFileInternal(const std::string &diskInstanceName, const uint64_t archiveFileId,
log::LogContext &lc) {
try {
const char *selectSql =
......
......@@ -126,6 +126,30 @@ public:
private:
/**
* Deletes the specified archive file and its associated tape copies from the
* catalogue.
*
* Please note that the name of the disk instance is specified in order to
* prevent a disk instance deleting an archive file that belongs to another
* disk instance.
*
* Please note that this method is idempotent. If the file to be deleted does
* not exist in the CTA catalogue then this method returns without error.
*
* This internal method can be re-tried if it throws a LostDatabaseConnection
* exception.
*
* @param instanceName The name of the instance from where the deletion request
* originated
* @param archiveFileId The unique identifier of the archive file.
* @param lc The log context.
* @return The metadata of the deleted archive file including the metadata of
* the associated and also deleted tape copies.
*/
void deleteArchiveFileInternal(const std::string &diskInstanceName, const uint64_t archiveFileId,
log::LogContext &lc);
/**
* Notifies the catalogue that the specified files have been written to tape.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment