Skip to content

Commit 3b72f55

Browse files
committed
MGM/FST: Add mechanism to register recovered stripes for RAIN files that are
not the ones at the entry server. This scenario covers the cases for under- replicated RAIN files. During recovery the entry server is the only one allowed to register/drop stripes and this the only place where we know for sure if the transfer was successful or not - this is why the other stripes can not commit this information themselves.
1 parent a347afb commit 3b72f55

2 files changed

Lines changed: 44 additions & 6 deletions

File tree

fst/XrdFstOfsFile.cc

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,7 +1904,7 @@ XrdFstOfsFile::_close_wr()
19041904
}
19051905

19061906
// Commit to MGM in case of rain reconstruction and not del on close
1907-
if (mRainReconstruct && !mDelOnClose) {
1907+
if (mRainReconstruct && mLayout->IsEntryServer() && !mDelOnClose) {
19081908
if ((rc = CommitToMgm())) {
19091909
if ((error.getErrInfo() == EIDRM) ||
19101910
(error.getErrInfo() == EBADE) ||
@@ -3980,6 +3980,7 @@ XrdFstOfsFile::NotifyProtoWfEndPointClosew(uint64_t file_id,
39803980
cta::xrd::Response response;
39813981
cta::xrd::Response::ResponseType response_type =
39823982
cta::xrd::Response::RSP_INVALID;
3983+
39833984
auto root_certs = gOFS.ConcatenatedServerRootCA;
39843985

39853986
try {
@@ -4268,6 +4269,7 @@ XrdFstOfsFile::CommitToMgm()
42684269
{
42694270
using eos::common::StringConversion;
42704271
std::ostringstream oss;
4272+
bool added_fsid = false;
42714273
const std::string smtime = StringConversion::GetSizeString((unsigned long long)
42724274
(mForcedMtime != 1) ?
42734275
mForcedMtime :
@@ -4284,7 +4286,6 @@ XrdFstOfsFile::CommitToMgm()
42844286
<< "&mgm.size=" << mCloseSize
42854287
<< "&mgm.mtime=" << smtime
42864288
<< "&mgm.mtime_ns=" << smtime_ns
4287-
<< "&mgm.add.fsid=" << mFmd->mProtoFmd.fsid()
42884289
<< "&mgm.logid=" << logId;
42894290

42904291
if (mCheckSum) {
@@ -4318,7 +4319,25 @@ XrdFstOfsFile::CommitToMgm()
43184319
ptr = mOpenOpaque->Get("eos.pio.recfs");
43194320

43204321
if ((mHasReadErr == false) && ptr) {
4321-
oss << "&mgm.drop.fsid=" << ptr;
4322+
if (strncmp(ptr, "0", 1) == 0) {
4323+
// Rain reconstruction with possibly adding new fses which
4324+
// are present in the opaque information
4325+
ptr = mOpenOpaque->Get("eos.pio.addfs");
4326+
4327+
if (ptr) {
4328+
oss << "&mgm.add.fsid=";
4329+
std::vector<std::string> fsid_tokens;
4330+
eos::common::StringConversion::Tokenize(ptr, fsid_tokens, ",");
4331+
4332+
for (auto id : fsid_tokens) {
4333+
oss << id;
4334+
added_fsid = true;
4335+
break;
4336+
}
4337+
}
4338+
} else {
4339+
oss << "&mgm.drop.fsid=" << ptr;
4340+
}
43224341
}
43234342
}
43244343
} else {
@@ -4349,6 +4368,10 @@ XrdFstOfsFile::CommitToMgm()
43494368
}
43504369
}
43514370

4371+
if (!added_fsid) {
4372+
oss << "&mgm.add.fsid=" << mFmd->mProtoFmd.fsid();
4373+
}
4374+
43524375
// Evt. tag as an OC-Chunk commit
43534376
if (mIsOCchunk) {
43544377
oss << eos::common::OwnCloud::FilterOcQuery(mOpenOpaque->Env(envlen));

mgm/XrdMgmOfsFile.cc

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3022,9 +3022,10 @@ XrdMgmOfsFile::open(eos::common::VirtualIdentity* invid,
30223022
capability += (int) fs_id;
30233023
eos::mgm::FileSystem* repfilesystem = 0;
30243024
replacedfs.resize(selectedfs.size());
3025-
30263025
// If replacement has been specified try to get new locations for
30273026
// reconstruction or for missing stripes
3027+
std::set<unsigned int> add_new_fsid;
3028+
30283029
if (isPioReconstruct && !(pio_reconstruct_fs.empty())) {
30293030
const char* containertag = 0;
30303031

@@ -3078,7 +3079,7 @@ XrdMgmOfsFile::open(eos::common::VirtualIdentity* invid,
30783079
plain_book_sz = std::ceil((float) plain_book_sz / std::pow(num_data_stripes,
30793080
2)) *
30803081
num_data_stripes * LayoutId::GetBlocksize(layoutId) + LayoutId::OssXsBlockSize;
3081-
eos_info("msg=\"plain booking size is %llu", plain_book_sz);
3082+
eos_info("msg=\"plain booking size is %llu\"", plain_book_sz);
30823083
eos::common::VirtualIdentity rootvid = eos::common::VirtualIdentity::Root();
30833084
// Attempt to use a firewall entrypoint or a dataproxy if required, if any
30843085
// of the two fail, then scheduling fails
@@ -3138,8 +3139,10 @@ XrdMgmOfsFile::open(eos::common::VirtualIdentity* invid,
31383139
}
31393140

31403141
for (size_t i = 0; i < selection_diff; ++i) {
3141-
selectedfs.push_back(pio_replacement_fs.back());
3142+
unsigned int fsid = pio_replacement_fs.back();
31423143
pio_replacement_fs.pop_back();
3144+
selectedfs.push_back(fsid);
3145+
add_new_fsid.insert(fsid);
31433146
}
31443147
}
31453148

@@ -3339,6 +3342,18 @@ XrdMgmOfsFile::open(eos::common::VirtualIdentity* invid,
33393342
infolog += ") ";
33403343
}
33413344
} // fs_rd_lock
3345+
3346+
if (isPioReconstruct && !add_new_fsid.empty()) {
3347+
std::string pio_addfs = "eos.pio.addfs=";
3348+
3349+
for (const auto& elem : add_new_fsid) {
3350+
pio_addfs += std::to_string(elem).c_str();
3351+
pio_addfs += ",";
3352+
}
3353+
3354+
pio_addfs.erase(pio_addfs.length() - 1, 1);
3355+
redirectionhost += pio_addfs.c_str();
3356+
}
33423357
}
33433358

33443359
// ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)