Skip to content
Snippets Groups Projects
Commit ddeed591 authored by Elvin Sindrilaru's avatar Elvin Sindrilaru
Browse files

XROOTD: Add option to allow transfers without notifying the diskmanager

The XROOTD_NO_DISKMGR_NOTIFY environment variable can be set to skip
notifying the diskmanagerd about the ongoing transfers from XRootD.
This should ONLY be enabled on a tape testing instance.
parent 81ca7875
No related branches found
No related tags found
No related merge requests found
......@@ -103,7 +103,8 @@ extern "C"
XrdxCastor2Ofs::XrdxCastor2Ofs():
XrdOfs(),
LogId(),
mLogLevel(LOG_INFO)
mLogLevel(LOG_INFO),
mNotifyDMgr(true)
{ }
......@@ -199,6 +200,17 @@ int XrdxCastor2Ofs::Configure(XrdSysError& Eroute, XrdOucEnv* envP)
// Set the effective user for all the XrdClients used to issue 'prepares'
// to redirector
setenv("XrdClientEUSER", "stage", 1);
// Check if we need to notify the diskmanager about transfers - this should
// be on only for testing
val = getenv("XROOTD_NO_DISKMGR_NOTIFY");
if (val && strncmp(val, "1", 1) == 0)
{
xcastor_warning("WARNING: Diskmanager notifications disabled");
mNotifyDMgr = false;
}
return rc;
}
......@@ -504,7 +516,7 @@ XrdxCastor2OfsFile::open(const char* path,
int rc = openrc;
// Notify the diskmanager
if (!mTransferId.empty())
if (!mTransferId.empty() && gSrv->NotifyDiskMgr())
{
TIMING("NOTIFY_DM", &open_timing);
char* errmsg = (char*)0;
......@@ -663,7 +675,7 @@ XrdxCastor2OfsFile::close()
// If we have contact info for the diskmanager then we contact it to pass the
// status otherwise this is a d2d or an rtcpd transfer and we don't need to
// contact the diskmanager.
if (mDiskMgrPort)
if (mDiskMgrPort && gSrv->NotifyDiskMgr())
{
TIMING("NOTIFY_DM", &close_timing);
uint64_t sz_file = 0;
......
......@@ -430,6 +430,17 @@ class XrdxCastor2Ofs : public XrdOfs, public LogId
//----------------------------------------------------------------------------
void SetLogLevel(int logLevel);
//----------------------------------------------------------------------------
//! Decide if we notify or not the disk manager about ongoing transfers. This
//! is used only for testing the functionality of the XRootD server in without
//! coupling it with the rest of the CASTOR infrastructure.
//!
//! @return true if notifications are sent, otherwise false
//----------------------------------------------------------------------------
inline bool NotifyDiskMgr() const
{
return mNotifyDMgr;
};
XrdSysMutex mTpcMapMutex; ///< mutex to protect access to the TPC map
std::map<std::string, struct TpcInfo> mTpcMap; ///< TPC map of key to lfn
......@@ -457,6 +468,7 @@ class XrdxCastor2Ofs : public XrdOfs, public LogId
int mLogLevel; ///< log level from configuration file
bool mNotifyDMgr; ///< if false skip notifying the diskmgr about transfers
XrdSysError* Eroute; ///< error object
XrdSysMutex mMutexTransfers; ///< mutex to protecte access to the transfer list
std::set<std::string> mSetTransfers; ///< set of ongoing transfers
......
################################################################################
#-------------------------------------------------------------------------------
# Should we run with another limit on the core file size other than the default?
#-------------------------------------------------------------------------------
DAEMON_COREFILE_LIMIT=unlimited
#-------------------------------------------------------------------------------
# What roles should the xroot daemon run for. For each role you can overwrite
# the default options using a dedicate sysconfig file
# e.g. /etc/sysconfig/xrd.<role>. The role based mechanism allows for
# multiple xrd's running with different options to be controlled via
# the same initd script
################################################################################
#-------------------------------------------------------------------------------
XROOTD_USER=stage
XROOTD_GROUP=st
################################################################################
XROOTD_INSTANCES="server"
XROOTD_SERVER_OPTIONS="-l /var/log/xrootd/xrootd.log -c /etc/xrd.cf.server -k 7"
################################################################################
#-------------------------------------------------------------------------------
# For tape testing one can enable the following environment variable which
# disables the notifications sent by the XRootD server to the diskmanager
# thus enabling to test the tape transfers without the whole CASTOR setup.
# Uncomment to enable.
#-------------------------------------------------------------------------------
# export XROOTD_NO_DISKMGR_NOTIFY=1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment