diff --git a/catalogue/Catalogue.hpp b/catalogue/Catalogue.hpp index 1420ce499c559c8ff3c3d7d4835382a548a590a3..dea47dc6b696d8ba0baeab538112f1f0c2a91e13 100644 --- a/catalogue/Catalogue.hpp +++ b/catalogue/Catalogue.hpp @@ -798,7 +798,6 @@ public: virtual void modifyMountPolicyArchiveMinRequestAge(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t minArchiveRequestAge) = 0; virtual void modifyMountPolicyRetrievePriority(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t retrievePriority) = 0; virtual void modifyMountPolicyRetrieveMinRequestAge(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t minRetrieveRequestAge) = 0; - virtual void modifyMountPolicyMaxDrivesAllowed(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t maxDrivesAllowed) = 0; virtual void modifyMountPolicyComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) = 0; virtual void createActivitiesFairShareWeight(const common::dataStructures::SecurityIdentity &admin, const std::string & diskInstanceName, const std::string & acttivity, diff --git a/catalogue/CatalogueRetryWrapper.hpp b/catalogue/CatalogueRetryWrapper.hpp index 08536aa1cf47fef5cd126c4372e68ebad45a8258..e478ab41ccefe6d7bb9e5b324261635c7d15c854 100644 --- a/catalogue/CatalogueRetryWrapper.hpp +++ b/catalogue/CatalogueRetryWrapper.hpp @@ -140,12 +140,12 @@ public: return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyVirtualOrganizationName(admin,currentVoName,newVoName);}, m_maxTriesToConnect); } - void modifyVirtualOrganizationReadMaxDrives(const common::dataStructures::SecurityIdentity &admin, const std::string &voName, const uint64_t maxDrivesAllowedForRead) override { - return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyVirtualOrganizationReadMaxDrives(admin,voName,maxDrivesAllowedForRead);}, m_maxTriesToConnect); + void modifyVirtualOrganizationReadMaxDrives(const common::dataStructures::SecurityIdentity &admin, const std::string &voName, const uint64_t readMaxDrives) override { + return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyVirtualOrganizationReadMaxDrives(admin,voName,readMaxDrives);}, m_maxTriesToConnect); } - void modifyVirtualOrganizationWriteMaxDrives(const common::dataStructures::SecurityIdentity &admin, const std::string &voName, const uint64_t maxDrivesAllowedForWrite) override { - return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyVirtualOrganizationWriteMaxDrives(admin,voName,maxDrivesAllowedForWrite);}, m_maxTriesToConnect); + void modifyVirtualOrganizationWriteMaxDrives(const common::dataStructures::SecurityIdentity &admin, const std::string &voName, const uint64_t writeMaxDrives) override { + return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyVirtualOrganizationWriteMaxDrives(admin,voName,writeMaxDrives);}, m_maxTriesToConnect); } @@ -470,10 +470,6 @@ public: return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyMountPolicyRetrieveMinRequestAge(admin, name, minRetrieveRequestAge);}, m_maxTriesToConnect); } - void modifyMountPolicyMaxDrivesAllowed(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t maxDrivesAllowed) override { - return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyMountPolicyMaxDrivesAllowed(admin, name, maxDrivesAllowed);}, m_maxTriesToConnect); - } - void modifyMountPolicyComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) override { return retryOnLostConnection(m_log, [&]{return m_catalogue->modifyMountPolicyComment(admin, name, comment);}, m_maxTriesToConnect); } diff --git a/catalogue/CatalogueTest.cpp b/catalogue/CatalogueTest.cpp index e953dcd6d0056278ef54d59a2c355fbc3cd979dd..96056b61be64850d6a7beea3f0980e4f71d4cee8 100644 --- a/catalogue/CatalogueTest.cpp +++ b/catalogue/CatalogueTest.cpp @@ -152,7 +152,6 @@ namespace { mountPolicy.minArchiveRequestAge = 2; mountPolicy.retrievePriority = 3; mountPolicy.minRetrieveRequestAge = 4; - mountPolicy.maxDrivesAllowed = 5; mountPolicy.comment = "Create mount policy"; return mountPolicy; } @@ -6422,8 +6421,6 @@ TEST_P(cta_catalogue_CatalogueTest, createMountPolicy) { ASSERT_EQ(mountPolicyToAdd.retrievePriority, mountPolicy.retrievePriority); ASSERT_EQ(mountPolicyToAdd.minRetrieveRequestAge, mountPolicy.retrieveMinRequestAge); - ASSERT_EQ(mountPolicyToAdd.maxDrivesAllowed, mountPolicy.maxDrivesAllowed); - ASSERT_EQ(mountPolicyToAdd.comment, mountPolicy.comment); const common::dataStructures::EntryLog creationLog = mountPolicy.creationLog; @@ -6617,43 +6614,6 @@ TEST_P(cta_catalogue_CatalogueTest, modifyMountPolicyRetrieveMinRequestAge_nonEx ASSERT_THROW(m_catalogue->modifyMountPolicyRetrieveMinRequestAge(m_admin, name, minRetrieveRequestAge), exception::UserError); } -TEST_P(cta_catalogue_CatalogueTest, modifyMountPolicyMaxDrivesAllowed) { - using namespace cta; - - ASSERT_TRUE(m_catalogue->getMountPolicies().empty()); - - auto mountPolicyToAdd = getMountPolicy1(); - std::string mountPolicyName = mountPolicyToAdd.name; - m_catalogue->createMountPolicy(m_admin,mountPolicyToAdd); - - const uint64_t modifiedMaxDrivesAllowed = mountPolicyToAdd.maxDrivesAllowed + 10; - m_catalogue->modifyMountPolicyMaxDrivesAllowed(m_admin, mountPolicyName, modifiedMaxDrivesAllowed); - - { - const std::list<common::dataStructures::MountPolicy> mountPolicies = m_catalogue->getMountPolicies(); - ASSERT_EQ(1, mountPolicies.size()); - - const common::dataStructures::MountPolicy mountPolicy = mountPolicies.front(); - - ASSERT_EQ(modifiedMaxDrivesAllowed, mountPolicy.maxDrivesAllowed); - - const common::dataStructures::EntryLog modificationLog = mountPolicy.lastModificationLog; - ASSERT_EQ(m_admin.username, modificationLog.username); - ASSERT_EQ(m_admin.host, modificationLog.host); - } -} - -TEST_P(cta_catalogue_CatalogueTest, modifyMountPolicyMaxDrivesAllowed_nonExistentMountPolicy) { - using namespace cta; - - ASSERT_TRUE(m_catalogue->getMountPolicies().empty()); - - const std::string name = "mount_policy"; - const uint64_t maxDrivesAllowed = 2; - - ASSERT_THROW(m_catalogue->modifyMountPolicyMaxDrivesAllowed(m_admin, name, maxDrivesAllowed), exception::UserError); -} - TEST_P(cta_catalogue_CatalogueTest, modifyMountPolicyComment) { using namespace cta; @@ -8014,7 +7974,6 @@ TEST_P(cta_catalogue_CatalogueTest, prepareToRetrieveFileUsingArchiveFileId) { auto mountPolicyToAdd = getMountPolicy1(); std::string mountPolicyName = mountPolicyToAdd.name; uint64_t minArchiveRequestAge = mountPolicyToAdd.minArchiveRequestAge; - uint64_t maxDrivesAllowed = mountPolicyToAdd.maxDrivesAllowed; uint64_t archivePriority = mountPolicyToAdd.archivePriority; m_catalogue->createMountPolicy(m_admin,mountPolicyToAdd); @@ -8046,7 +8005,6 @@ TEST_P(cta_catalogue_CatalogueTest, prepareToRetrieveFileUsingArchiveFileId) { ASSERT_EQ(2, queueCriteria.archiveFile.tapeFiles.size()); ASSERT_EQ(archivePriority, queueCriteria.mountPolicy.archivePriority); ASSERT_EQ(minArchiveRequestAge, queueCriteria.mountPolicy.archiveMinRequestAge); - ASSERT_EQ(maxDrivesAllowed, queueCriteria.mountPolicy.maxDrivesAllowed); // Check that the diskInstanceName mismatch detection works ASSERT_THROW(m_catalogue->prepareToRetrieveFile(diskInstanceName2, archiveFileId, requesterIdentity, cta::nullopt, dummyLc), @@ -8241,7 +8199,6 @@ TEST_P(cta_catalogue_CatalogueTest, prepareToRetrieveFileUsingArchiveFileId_disa auto mountPolicyToAdd = getMountPolicy1(); std::string mountPolicyName = mountPolicyToAdd.name; uint64_t minArchiveRequestAge = mountPolicyToAdd.minArchiveRequestAge; - uint64_t maxDrivesAllowed = mountPolicyToAdd.maxDrivesAllowed; uint64_t archivePriority = mountPolicyToAdd.archivePriority; m_catalogue->createMountPolicy(m_admin,mountPolicyToAdd); @@ -8274,7 +8231,6 @@ TEST_P(cta_catalogue_CatalogueTest, prepareToRetrieveFileUsingArchiveFileId_disa ASSERT_EQ(archivePriority, queueCriteria.mountPolicy.archivePriority); ASSERT_EQ(minArchiveRequestAge, queueCriteria.mountPolicy.archiveMinRequestAge); - ASSERT_EQ(maxDrivesAllowed, queueCriteria.mountPolicy.maxDrivesAllowed); ASSERT_EQ(2, queueCriteria.archiveFile.tapeFiles.size()); @@ -8304,7 +8260,6 @@ TEST_P(cta_catalogue_CatalogueTest, prepareToRetrieveFileUsingArchiveFileId_disa ASSERT_EQ(archivePriority, queueCriteria.mountPolicy.archivePriority); ASSERT_EQ(minArchiveRequestAge, queueCriteria.mountPolicy.archiveMinRequestAge); - ASSERT_EQ(maxDrivesAllowed, queueCriteria.mountPolicy.maxDrivesAllowed); ASSERT_EQ(1, queueCriteria.archiveFile.tapeFiles.size()); @@ -8400,7 +8355,6 @@ TEST_P(cta_catalogue_CatalogueTest, prepareToRetrieveFileUsingArchiveFileId_retu auto mountPolicyToAdd = getMountPolicy1(); std::string mountPolicyName = mountPolicyToAdd.name; uint64_t minArchiveRequestAge = mountPolicyToAdd.minArchiveRequestAge; - uint64_t maxDrivesAllowed = mountPolicyToAdd.maxDrivesAllowed; uint64_t archivePriority = mountPolicyToAdd.archivePriority; m_catalogue->createMountPolicy(m_admin,mountPolicyToAdd); @@ -8420,7 +8374,6 @@ TEST_P(cta_catalogue_CatalogueTest, prepareToRetrieveFileUsingArchiveFileId_retu ASSERT_EQ(archivePriority, queueCriteria.mountPolicy.archivePriority); ASSERT_EQ(minArchiveRequestAge, queueCriteria.mountPolicy.archiveMinRequestAge); - ASSERT_EQ(maxDrivesAllowed, queueCriteria.mountPolicy.maxDrivesAllowed); ASSERT_EQ(1, queueCriteria.archiveFile.tapeFiles.size()); @@ -14720,40 +14673,40 @@ TEST_P(cta_catalogue_CatalogueTest, modifyVirtualOrganizationComment) { ASSERT_THROW(m_catalogue->modifyVirtualOrganizationComment(m_admin,"DOES not exists","COMMENT_DOES_NOT_EXIST"),cta::exception::UserError); } -TEST_P(cta_catalogue_CatalogueTest, modifyVirtualOrganizationMaxDrivesAllowedForRead) { +TEST_P(cta_catalogue_CatalogueTest, modifyVirtualOrganizationReadMaxDrives) { using namespace cta; common::dataStructures::VirtualOrganization vo = getVo(); ASSERT_NO_THROW(m_catalogue->createVirtualOrganization(m_admin,vo)); - uint64_t newMaxDrivesAllowedForRead = 42; - ASSERT_NO_THROW(m_catalogue->modifyVirtualOrganizationReadMaxDrives(m_admin,vo.name,newMaxDrivesAllowedForRead)); + uint64_t readMaxDrives = 42; + ASSERT_NO_THROW(m_catalogue->modifyVirtualOrganizationReadMaxDrives(m_admin,vo.name,readMaxDrives)); auto vos = m_catalogue->getVirtualOrganizations(); auto &frontVo = vos.front(); - ASSERT_EQ(newMaxDrivesAllowedForRead,frontVo.readMaxDrives); + ASSERT_EQ(readMaxDrives,frontVo.readMaxDrives); - ASSERT_THROW(m_catalogue->modifyVirtualOrganizationReadMaxDrives(m_admin,"DOES not exists",newMaxDrivesAllowedForRead),cta::exception::UserError); + ASSERT_THROW(m_catalogue->modifyVirtualOrganizationReadMaxDrives(m_admin,"DOES not exists",readMaxDrives),cta::exception::UserError); } -TEST_P(cta_catalogue_CatalogueTest, modifyVirtualOrganizationMaxDrivesAllowedForWrite) { +TEST_P(cta_catalogue_CatalogueTest, modifyVirtualOrganizationWriteMaxDrives) { using namespace cta; common::dataStructures::VirtualOrganization vo = getVo(); ASSERT_NO_THROW(m_catalogue->createVirtualOrganization(m_admin,vo)); - uint64_t newMaxDrivesAllowedForWrite = 42; - ASSERT_NO_THROW(m_catalogue->modifyVirtualOrganizationWriteMaxDrives(m_admin,vo.name,newMaxDrivesAllowedForWrite)); + uint64_t writeMaxDrives = 42; + ASSERT_NO_THROW(m_catalogue->modifyVirtualOrganizationWriteMaxDrives(m_admin,vo.name,writeMaxDrives)); auto vos = m_catalogue->getVirtualOrganizations(); auto &frontVo = vos.front(); - ASSERT_EQ(newMaxDrivesAllowedForWrite,frontVo.writeMaxDrives); + ASSERT_EQ(writeMaxDrives,frontVo.writeMaxDrives); - ASSERT_THROW(m_catalogue->modifyVirtualOrganizationWriteMaxDrives(m_admin,"DOES not exists",newMaxDrivesAllowedForWrite),cta::exception::UserError); + ASSERT_THROW(m_catalogue->modifyVirtualOrganizationWriteMaxDrives(m_admin,"DOES not exists",writeMaxDrives),cta::exception::UserError); } TEST_P(cta_catalogue_CatalogueTest, getVirtualOrganizationOfTapepool) { diff --git a/catalogue/CreateMountPolicyAttributes.hpp b/catalogue/CreateMountPolicyAttributes.hpp index fbd5998033a767f1094009f206b9c592d040838c..bb5e8d100967e5cae4bb92336d678cb1ce011dbe 100644 --- a/catalogue/CreateMountPolicyAttributes.hpp +++ b/catalogue/CreateMountPolicyAttributes.hpp @@ -32,7 +32,6 @@ namespace catalogue { uint64_t minArchiveRequestAge; uint64_t retrievePriority; uint64_t minRetrieveRequestAge; - uint64_t maxDrivesAllowed; std::string comment; }; diff --git a/catalogue/DummyCatalogue.hpp b/catalogue/DummyCatalogue.hpp index 5e39a74c787cca847a4481d4c9476db6303c1722..50203d57a93b9c0d8f84b592db682686abbeaa40 100644 --- a/catalogue/DummyCatalogue.hpp +++ b/catalogue/DummyCatalogue.hpp @@ -109,8 +109,8 @@ public: common::dataStructures::VirtualOrganization getVirtualOrganizationOfTapepool(const std::string & tapepoolName) const override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } common::dataStructures::VirtualOrganization getCachedVirtualOrganizationOfTapepool(const std::string & tapepoolName) const override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void modifyVirtualOrganizationName(const common::dataStructures::SecurityIdentity &admin, const std::string ¤tVoName, const std::string &newVoName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } - void modifyVirtualOrganizationReadMaxDrives(const common::dataStructures::SecurityIdentity &admin, const std::string &voName, const uint64_t maxDrivesAllowedForRead) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } - void modifyVirtualOrganizationWriteMaxDrives(const common::dataStructures::SecurityIdentity &admin, const std::string &voName, const uint64_t maxDrivesAllowedForWrite) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } + void modifyVirtualOrganizationReadMaxDrives(const common::dataStructures::SecurityIdentity &admin, const std::string &voName, const uint64_t readMaxDrives) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } + void modifyVirtualOrganizationWriteMaxDrives(const common::dataStructures::SecurityIdentity &admin, const std::string &voName, const uint64_t writeMaxDrives) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void modifyVirtualOrganizationComment(const common::dataStructures::SecurityIdentity &admin, const std::string &voName, const std::string &comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void modifyArchiveRouteComment(const common::dataStructures::SecurityIdentity& admin, const std::string& storageClassName, const uint32_t copyNb, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void modifyArchiveRouteTapePoolName(const common::dataStructures::SecurityIdentity& admin, const std::string& storageClassName, const uint32_t copyNb, const std::string& tapePoolName) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } @@ -120,7 +120,6 @@ public: void modifyMountPolicyArchiveMinRequestAge(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const uint64_t minArchiveRequestAge) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void modifyMountPolicyArchivePriority(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const uint64_t archivePriority) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void modifyMountPolicyComment(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } - void modifyMountPolicyMaxDrivesAllowed(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const uint64_t maxDrivesAllowed) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void modifyMountPolicyRetrieveMinRequestAge(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const uint64_t minRetrieveRequestAge) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void modifyMountPolicyRetrievePriority(const common::dataStructures::SecurityIdentity& admin, const std::string& name, const uint64_t retrievePriority) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } void modifyRequesteMountRuleComment(const common::dataStructures::SecurityIdentity& admin, const std::string& instanceName, const std::string& requesterName, const std::string& comment) override { throw exception::Exception(std::string("In ")+__PRETTY_FUNCTION__+": not implemented"); } @@ -200,7 +199,6 @@ public: mp1.archiveMinRequestAge = 0; mp1.retrievePriority = 1; mp1.retrieveMinRequestAge = 0; - mp1.maxDrivesAllowed = 10; mountPolicies.push_back(mp1); common::dataStructures::MountPolicy mp2; @@ -209,7 +207,6 @@ public: mp2.archiveMinRequestAge = 0; mp2.retrievePriority = 2; mp2.retrieveMinRequestAge = 0; - mp2.maxDrivesAllowed = 10; mountPolicies.push_back(mp1); return mountPolicies; } @@ -222,7 +219,6 @@ public: mp1.archiveMinRequestAge = 0; mp1.retrievePriority = 1; mp1.retrieveMinRequestAge = 0; - mp1.maxDrivesAllowed = 10; mountPolicies.push_back(mp1); common::dataStructures::MountPolicy mp2; @@ -231,7 +227,6 @@ public: mp2.archiveMinRequestAge = 0; mp2.retrievePriority = 2; mp2.retrieveMinRequestAge = 0; - mp2.maxDrivesAllowed = 10; mountPolicies.push_back(mp1); return mountPolicies; } diff --git a/catalogue/RdbmsCatalogue.cpp b/catalogue/RdbmsCatalogue.cpp index 962c32a8debb0f9104a54102f67730d60b791109..e2fc6cfe119f0de79b8a179c92e2850fede0c600 100644 --- a/catalogue/RdbmsCatalogue.cpp +++ b/catalogue/RdbmsCatalogue.cpp @@ -614,7 +614,7 @@ void RdbmsCatalogue::modifyVirtualOrganizationName(const common::dataStructures: } } -void RdbmsCatalogue::modifyVirtualOrganizationReadMaxDrives(const common::dataStructures::SecurityIdentity &admin, const std::string &voName, const uint64_t maxDrivesAllowedForRead){ +void RdbmsCatalogue::modifyVirtualOrganizationReadMaxDrives(const common::dataStructures::SecurityIdentity &admin, const std::string &voName, const uint64_t readMaxDrives){ try { const time_t now = time(nullptr); const char *const sql = @@ -628,7 +628,7 @@ void RdbmsCatalogue::modifyVirtualOrganizationReadMaxDrives(const common::dataSt auto conn = m_connPool.getConn(); auto stmt = conn.createStmt(sql); - stmt.bindUint64(":READ_MAX_DRIVES", maxDrivesAllowedForRead); + stmt.bindUint64(":READ_MAX_DRIVES", readMaxDrives); stmt.bindString(":LAST_UPDATE_USER_NAME", admin.username); stmt.bindString(":LAST_UPDATE_HOST_NAME", admin.host); stmt.bindUint64(":LAST_UPDATE_TIME", now); @@ -650,7 +650,7 @@ void RdbmsCatalogue::modifyVirtualOrganizationReadMaxDrives(const common::dataSt } } -void RdbmsCatalogue::modifyVirtualOrganizationWriteMaxDrives(const common::dataStructures::SecurityIdentity &admin, const std::string &voName, const uint64_t maxDrivesAllowedForWrite){ +void RdbmsCatalogue::modifyVirtualOrganizationWriteMaxDrives(const common::dataStructures::SecurityIdentity &admin, const std::string &voName, const uint64_t writeMaxDrives){ try { const time_t now = time(nullptr); const char *const sql = @@ -664,7 +664,7 @@ void RdbmsCatalogue::modifyVirtualOrganizationWriteMaxDrives(const common::dataS auto conn = m_connPool.getConn(); auto stmt = conn.createStmt(sql); - stmt.bindUint64(":WRITE_MAX_DRIVES", maxDrivesAllowedForWrite); + stmt.bindUint64(":WRITE_MAX_DRIVES", writeMaxDrives); stmt.bindString(":LAST_UPDATE_USER_NAME", admin.username); stmt.bindString(":LAST_UPDATE_HOST_NAME", admin.host); stmt.bindUint64(":LAST_UPDATE_TIME", now); @@ -5142,8 +5142,6 @@ void RdbmsCatalogue::createMountPolicy(const common::dataStructures::SecurityIde "RETRIEVE_PRIORITY," "RETRIEVE_MIN_REQUEST_AGE," - "MAX_DRIVES_ALLOWED," - "USER_COMMENT," "CREATION_LOG_USER_NAME," @@ -5162,8 +5160,6 @@ void RdbmsCatalogue::createMountPolicy(const common::dataStructures::SecurityIde ":RETRIEVE_PRIORITY," ":RETRIEVE_MIN_REQUEST_AGE," - ":MAX_DRIVES_ALLOWED," - ":USER_COMMENT," ":CREATION_LOG_USER_NAME," @@ -5182,8 +5178,6 @@ void RdbmsCatalogue::createMountPolicy(const common::dataStructures::SecurityIde stmt.bindUint64(":RETRIEVE_PRIORITY", mountPolicy.retrievePriority); stmt.bindUint64(":RETRIEVE_MIN_REQUEST_AGE", mountPolicy.minRetrieveRequestAge); - - stmt.bindUint64(":MAX_DRIVES_ALLOWED", mountPolicy.maxDrivesAllowed); stmt.bindString(":USER_COMMENT", mountPolicy.comment); @@ -5490,8 +5484,6 @@ optional<common::dataStructures::MountPolicy> RdbmsCatalogue::getRequesterGroupM "MOUNT_POLICY.RETRIEVE_PRIORITY AS RETRIEVE_PRIORITY," "MOUNT_POLICY.RETRIEVE_MIN_REQUEST_AGE AS RETRIEVE_MIN_REQUEST_AGE," - "MOUNT_POLICY.MAX_DRIVES_ALLOWED AS MAX_DRIVES_ALLOWED," - "MOUNT_POLICY.USER_COMMENT AS USER_COMMENT," "MOUNT_POLICY.CREATION_LOG_USER_NAME AS CREATION_LOG_USER_NAME," @@ -5525,8 +5517,6 @@ optional<common::dataStructures::MountPolicy> RdbmsCatalogue::getRequesterGroupM policy.retrievePriority = rset.columnUint64("RETRIEVE_PRIORITY"); policy.retrieveMinRequestAge = rset.columnUint64("RETRIEVE_MIN_REQUEST_AGE"); - policy.maxDrivesAllowed = rset.columnUint64("MAX_DRIVES_ALLOWED"); - policy.comment = rset.columnString("USER_COMMENT"); policy.creationLog.username = rset.columnString("CREATION_LOG_USER_NAME"); policy.creationLog.host = rset.columnString("CREATION_LOG_HOST_NAME"); @@ -5719,8 +5709,6 @@ optional<common::dataStructures::MountPolicy> RdbmsCatalogue::getRequesterMountP "MOUNT_POLICY.RETRIEVE_PRIORITY AS RETRIEVE_PRIORITY," "MOUNT_POLICY.RETRIEVE_MIN_REQUEST_AGE AS RETRIEVE_MIN_REQUEST_AGE," - "MOUNT_POLICY.MAX_DRIVES_ALLOWED AS MAX_DRIVES_ALLOWED," - "MOUNT_POLICY.USER_COMMENT AS USER_COMMENT," "MOUNT_POLICY.CREATION_LOG_USER_NAME AS CREATION_LOG_USER_NAME," @@ -5754,8 +5742,6 @@ optional<common::dataStructures::MountPolicy> RdbmsCatalogue::getRequesterMountP policy.retrievePriority = rset.columnUint64("RETRIEVE_PRIORITY"); policy.retrieveMinRequestAge = rset.columnUint64("RETRIEVE_MIN_REQUEST_AGE"); - policy.maxDrivesAllowed = rset.columnUint64("MAX_DRIVES_ALLOWED"); - policy.comment = rset.columnString("USER_COMMENT"); policy.creationLog.username = rset.columnString("CREATION_LOG_USER_NAME"); @@ -5864,8 +5850,6 @@ try { "RETRIEVE_PRIORITY AS RETRIEVE_PRIORITY," "RETRIEVE_MIN_REQUEST_AGE AS RETRIEVE_MIN_REQUEST_AGE," - "MAX_DRIVES_ALLOWED AS MAX_DRIVES_ALLOWED," - "USER_COMMENT AS USER_COMMENT," "CREATION_LOG_USER_NAME AS CREATION_LOG_USER_NAME," @@ -5891,8 +5875,6 @@ try { policy.retrievePriority = rset.columnUint64("RETRIEVE_PRIORITY"); policy.retrieveMinRequestAge = rset.columnUint64("RETRIEVE_MIN_REQUEST_AGE"); - - policy.maxDrivesAllowed = rset.columnUint64("MAX_DRIVES_ALLOWED"); policy.comment = rset.columnString("USER_COMMENT"); @@ -6090,45 +6072,6 @@ void RdbmsCatalogue::modifyMountPolicyRetrieveMinRequestAge(const common::dataSt m_allMountPoliciesCache.invalidate(); } -//------------------------------------------------------------------------------ -// modifyMountPolicyMaxDrivesAllowed -//------------------------------------------------------------------------------ -void RdbmsCatalogue::modifyMountPolicyMaxDrivesAllowed(const common::dataStructures::SecurityIdentity &admin, - const std::string &name, const uint64_t maxDrivesAllowed) { - try { - const time_t now = time(nullptr); - const char *const sql = - "UPDATE MOUNT_POLICY SET " - "MAX_DRIVES_ALLOWED = :MAX_DRIVES_ALLOWED," - "LAST_UPDATE_USER_NAME = :LAST_UPDATE_USER_NAME," - "LAST_UPDATE_HOST_NAME = :LAST_UPDATE_HOST_NAME," - "LAST_UPDATE_TIME = :LAST_UPDATE_TIME " - "WHERE " - "MOUNT_POLICY_NAME = :MOUNT_POLICY_NAME"; - auto conn = m_connPool.getConn(); - auto stmt = conn.createStmt(sql); - stmt.bindUint64(":MAX_DRIVES_ALLOWED", maxDrivesAllowed); - stmt.bindString(":LAST_UPDATE_USER_NAME", admin.username); - stmt.bindString(":LAST_UPDATE_HOST_NAME", admin.host); - stmt.bindUint64(":LAST_UPDATE_TIME", now); - stmt.bindString(":MOUNT_POLICY_NAME", name); - stmt.executeNonQuery(); - - if(0 == stmt.getNbAffectedRows()) { - throw exception::UserError(std::string("Cannot modify mount policy ") + name + " because they do not exist"); - } - } catch(exception::UserError &) { - throw; - } catch(exception::Exception &ex) { - ex.getMessage().str(std::string(__FUNCTION__) + ": " + ex.getMessage().str()); - throw; - } - - m_groupMountPolicyCache.invalidate(); - m_userMountPolicyCache.invalidate(); - m_allMountPoliciesCache.invalidate(); -} - //------------------------------------------------------------------------------ // modifyMountPolicyComment //------------------------------------------------------------------------------ @@ -7650,7 +7593,6 @@ RequesterAndGroupMountPolicies RdbmsCatalogue::getMountPolicies( "MOUNT_POLICY.ARCHIVE_MIN_REQUEST_AGE AS ARCHIVE_MIN_REQUEST_AGE," "MOUNT_POLICY.RETRIEVE_PRIORITY AS RETRIEVE_PRIORITY," "MOUNT_POLICY.RETRIEVE_MIN_REQUEST_AGE AS RETRIEVE_MIN_REQUEST_AGE," - "MOUNT_POLICY.MAX_DRIVES_ALLOWED AS MAX_DRIVES_ALLOWED," "MOUNT_POLICY.USER_COMMENT AS USER_COMMENT," "MOUNT_POLICY.CREATION_LOG_USER_NAME AS CREATION_LOG_USER_NAME," "MOUNT_POLICY.CREATION_LOG_HOST_NAME AS CREATION_LOG_HOST_NAME," @@ -7677,7 +7619,6 @@ RequesterAndGroupMountPolicies RdbmsCatalogue::getMountPolicies( "MOUNT_POLICY.ARCHIVE_MIN_REQUEST_AGE AS ARCHIVE_MIN_REQUEST_AGE," "MOUNT_POLICY.RETRIEVE_PRIORITY AS RETRIEVE_PRIORITY," "MOUNT_POLICY.RETRIEVE_MIN_REQUEST_AGE AS RETRIEVE_MIN_REQUEST_AGE," - "MOUNT_POLICY.MAX_DRIVES_ALLOWED AS MAX_DRIVES_ALLOWED," "MOUNT_POLICY.USER_COMMENT AS USER_COMMENT," "MOUNT_POLICY.CREATION_LOG_USER_NAME AS CREATION_LOG_USER_NAME," "MOUNT_POLICY.CREATION_LOG_HOST_NAME AS CREATION_LOG_HOST_NAME," @@ -7711,7 +7652,6 @@ RequesterAndGroupMountPolicies RdbmsCatalogue::getMountPolicies( policy.archiveMinRequestAge = rset.columnUint64("ARCHIVE_MIN_REQUEST_AGE"); policy.retrievePriority = rset.columnUint64("RETRIEVE_PRIORITY"); policy.retrieveMinRequestAge = rset.columnUint64("RETRIEVE_MIN_REQUEST_AGE"); - policy.maxDrivesAllowed = rset.columnUint64("MAX_DRIVES_ALLOWED"); policy.comment = rset.columnString("USER_COMMENT"); policy.creationLog.username = rset.columnString("CREATION_LOG_USER_NAME"); policy.creationLog.host = rset.columnString("CREATION_LOG_HOST_NAME"); diff --git a/catalogue/RdbmsCatalogue.hpp b/catalogue/RdbmsCatalogue.hpp index 429114eb3a84b5b0590d43adab311e3070c513fc..e92f782b375b263c3df996f9a365414332fc6a4a 100644 --- a/catalogue/RdbmsCatalogue.hpp +++ b/catalogue/RdbmsCatalogue.hpp @@ -765,7 +765,6 @@ public: void modifyMountPolicyArchiveMinRequestAge(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t minArchiveRequestAge) override; void modifyMountPolicyRetrievePriority(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t retrievePriority) override; void modifyMountPolicyRetrieveMinRequestAge(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t minRetrieveRequestAge) override; - void modifyMountPolicyMaxDrivesAllowed(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const uint64_t maxDrivesAllowed) override; void modifyMountPolicyComment(const common::dataStructures::SecurityIdentity &admin, const std::string &name, const std::string &comment) override; void createActivitiesFairShareWeight(const common::dataStructures::SecurityIdentity &admin, const std::string & diskInstanceName, const std::string & activity, diff --git a/cmdline/CtaAdminCmdParse.hpp b/cmdline/CtaAdminCmdParse.hpp index 1906f63bdd7d721cf71b56aae7a6359aebcdc03b..def719bf41c896972577d75ea4087bc569c3eee7 100644 --- a/cmdline/CtaAdminCmdParse.hpp +++ b/cmdline/CtaAdminCmdParse.hpp @@ -277,7 +277,6 @@ const std::map<std::string, OptionUInt64::Key> uint64Options = { { "--capacity", OptionUInt64::CAPACITY }, { "--copynb", OptionUInt64::COPY_NUMBER }, { "--id", OptionUInt64::ARCHIVE_FILE_ID }, - { "--maxdrivesallowed", OptionUInt64::MAX_DRIVES_ALLOWED }, { "--maxlpos", OptionUInt64::MAX_LPOS }, { "--minarchiverequestage", OptionUInt64::MIN_ARCHIVE_REQUEST_AGE }, { "--minlpos", OptionUInt64::MIN_LPOS }, @@ -446,7 +445,6 @@ const Option opt_log { Option::OPT_FLAG, "--log", const Option opt_logicallibrary { Option::OPT_STR, "--logicallibrary", "-l", " <logical_library_name>" }; const Option opt_logicallibrary_alias { Option::OPT_STR, "--name", "-n", " <logical_library_name>", "--logicallibrary" }; const Option opt_lookupns { Option::OPT_FLAG, "--lookupnamespace", "-l", "" }; -const Option opt_maxdrivesallowed { Option::OPT_UINT, "--maxdrivesallowed", "-d", " <max_drives_allowed>" }; const Option opt_maxlpos { Option::OPT_UINT, "--maxlpos", "-maxl", " <maximum_longitudinal_position>" }; const Option opt_mediatype { Option::OPT_STR, "--mediatype", "--mt", " <media_type_name>" }; const Option opt_mediatype_alias { Option::OPT_STR, "--name", "-n", " <media_type_name>", "--mediatype" }; @@ -539,10 +537,10 @@ const std::map<cmd_key_t, cmd_val_t> cmdOptions = { /*----------------------------------------------------------------------------------------------------*/ {{ AdminCmd::CMD_MOUNTPOLICY, AdminCmd::SUBCMD_ADD }, { opt_mountpolicy_alias, opt_archivepriority, opt_minarchiverequestage, opt_retrievepriority, - opt_minretrieverequestage, opt_maxdrivesallowed, opt_comment }}, + opt_minretrieverequestage, opt_comment }}, {{ AdminCmd::CMD_MOUNTPOLICY, AdminCmd::SUBCMD_CH }, { opt_mountpolicy_alias, opt_archivepriority.optional(), opt_minarchiverequestage.optional(), - opt_retrievepriority.optional(), opt_minretrieverequestage.optional(), opt_maxdrivesallowed.optional(), + opt_retrievepriority.optional(), opt_minretrieverequestage.optional(), opt_comment.optional() }}, {{ AdminCmd::CMD_MOUNTPOLICY, AdminCmd::SUBCMD_RM }, { opt_mountpolicy_alias }}, {{ AdminCmd::CMD_MOUNTPOLICY, AdminCmd::SUBCMD_LS }, { }}, diff --git a/cmdline/CtaAdminTextFormatter.cpp b/cmdline/CtaAdminTextFormatter.cpp index 98622ec00b1ebf44d28a2a9bae45fd4887f1b14c..ca0e0199b0f49164f29e2d1bf00775b318c78481 100644 --- a/cmdline/CtaAdminTextFormatter.cpp +++ b/cmdline/CtaAdminTextFormatter.cpp @@ -580,7 +580,6 @@ void TextFormatter::printMountPolicyLsHeader() { "a.minAge", "r.priority", "r.minAge", - "max drives", "c.user", "c.host", "c.time", @@ -598,7 +597,6 @@ void TextFormatter::print(const MountPolicyLsItem &mpls_item) { mpls_item.archive_min_request_age(), mpls_item.retrieve_priority(), mpls_item.retrieve_min_request_age(), - mpls_item.max_drives_allowed(), mpls_item.creation_log().username(), mpls_item.creation_log().host(), timeToStr(mpls_item.creation_log().time()), diff --git a/common/dataStructures/MountPolicy.cpp b/common/dataStructures/MountPolicy.cpp index b7cbd1079a1d7e950056ddd455d2e58db0e783a0..9f3bb8f235c3e79188c89b69231bc6531aafcdcb 100644 --- a/common/dataStructures/MountPolicy.cpp +++ b/common/dataStructures/MountPolicy.cpp @@ -32,13 +32,12 @@ MountPolicy::MountPolicy(): archivePriority(0), archiveMinRequestAge(0), retrievePriority(0), - retrieveMinRequestAge(0), - maxDrivesAllowed(0){} + retrieveMinRequestAge(0){} MountPolicy::MountPolicy(const std::string name, const uint64_t archivePriority,const uint64_t archiveMinRequestAge, const uint64_t retrievePriority, - const uint64_t retrieveMinRequestAge, const uint64_t maxDrivesAllowed): + const uint64_t retrieveMinRequestAge): name(name), archivePriority(archivePriority), archiveMinRequestAge(archiveMinRequestAge), retrievePriority(retrievePriority), - retrieveMinRequestAge(retrieveMinRequestAge), maxDrivesAllowed(maxDrivesAllowed) {} + retrieveMinRequestAge(retrieveMinRequestAge) {} //------------------------------------------------------------------------------ // operator== //------------------------------------------------------------------------------ @@ -48,7 +47,6 @@ bool MountPolicy::operator==(const MountPolicy &rhs) const { && archiveMinRequestAge==rhs.archiveMinRequestAge && retrievePriority==rhs.retrievePriority && retrieveMinRequestAge==rhs.retrieveMinRequestAge - && maxDrivesAllowed==rhs.maxDrivesAllowed && creationLog==rhs.creationLog && lastModificationLog==rhs.lastModificationLog && comment==rhs.comment; @@ -68,7 +66,6 @@ MountPolicy MountPolicy::operator=(const MountPolicy& other){ this->comment = other.comment; this->creationLog = other.creationLog; this->lastModificationLog = other.lastModificationLog; - this->maxDrivesAllowed = other.maxDrivesAllowed; this->name = other.name; this->retrieveMinRequestAge = other.retrieveMinRequestAge; this->retrievePriority = other.retrievePriority; @@ -84,14 +81,13 @@ std::ostream &operator<<(std::ostream &os, const MountPolicy &obj) { << " archive_minRequestAge=" << obj.archiveMinRequestAge << " retrieve_priority=" << obj.retrievePriority << " retrieve_minRequestAge=" << obj.retrieveMinRequestAge - << " maxDrivesAllowed=" << obj.maxDrivesAllowed << " creationLog=" << obj.creationLog << " lastModificationLog=" << obj.lastModificationLog << " comment=" << obj.comment << ")"; return os; } -MountPolicy MountPolicy::s_defaultMountPolicyForRepack("default_mount_policy_repack",1,1,1,1,1); +MountPolicy MountPolicy::s_defaultMountPolicyForRepack("default_mount_policy_repack",1,1,1,1); } // namespace dataStructures } // namespace common diff --git a/common/dataStructures/MountPolicy.hpp b/common/dataStructures/MountPolicy.hpp index b8e85b34578d9453ec047abde73f7747bfa4104d..8215a7fdeabd5a7d0437f98b3a860484cda060d6 100644 --- a/common/dataStructures/MountPolicy.hpp +++ b/common/dataStructures/MountPolicy.hpp @@ -47,7 +47,6 @@ struct MountPolicy { uint64_t archiveMinRequestAge; uint64_t retrievePriority; uint64_t retrieveMinRequestAge; - uint64_t maxDrivesAllowed; EntryLog creationLog; EntryLog lastModificationLog; std::string comment; @@ -56,7 +55,7 @@ struct MountPolicy { static struct MountPolicy s_defaultMountPolicyForRepack; private: - MountPolicy(const std::string name,const uint64_t archivePriority,const uint64_t archiveMinRequestAge, const uint64_t retrievePriority, const uint64_t retrieveMinRequestAge, const uint64_t maxDrivesAllowed); + MountPolicy(const std::string name,const uint64_t archivePriority,const uint64_t archiveMinRequestAge, const uint64_t retrievePriority, const uint64_t retrieveMinRequestAge); }; // struct MountPolicy diff --git a/continuousintegration/orchestration/tests/prepare_tests.sh b/continuousintegration/orchestration/tests/prepare_tests.sh index 196d86310e3f6db84c8c1947b9cf0894ca15dbba..ec3f90c960d565f4bb284a9e83729958e4ed24a9 100755 --- a/continuousintegration/orchestration/tests/prepare_tests.sh +++ b/continuousintegration/orchestration/tests/prepare_tests.sh @@ -183,7 +183,6 @@ kubectl --namespace ${NAMESPACE} exec ctacli -- cta-admin --json version | jq --minarchiverequestage 1 \ --retrievepriority 1 \ --minretrieverequestage 1 \ - --maxdrivesallowed 1 \ --comment "ctasystest" kubectl --namespace ${NAMESPACE} exec ctacli -- cta-admin requestermountrule add \ --instance ${EOSINSTANCE} \ diff --git a/continuousintegration/orchestration/tests/simpletest.cli.sh b/continuousintegration/orchestration/tests/simpletest.cli.sh index d9007589a24f6b34cec9b832d4e423e8dc7ab32a..ce36c0f0c4c8937a1ef141394c5a32f6a0d091d5 100755 --- a/continuousintegration/orchestration/tests/simpletest.cli.sh +++ b/continuousintegration/orchestration/tests/simpletest.cli.sh @@ -12,7 +12,7 @@ cta storageclass add --instance root --name ctaStorageClass --copynb 1 --comment cta archiveroute add --instance root --storageclass ctaStorageClass --copynb 1 --tapepool ctasystest --comment "ctasystest" -cta mountpolicy add --name ctasystest --archivepriority 1 --minarchiverequestage 1 --retrievepriority 1 --minretrieverequestage 1 --maxdrivesallowed 1 --comment "ctasystest" +cta mountpolicy add --name ctasystest --archivepriority 1 --minarchiverequestage 1 --retrievepriority 1 --minretrieverequestage 1 --comment "ctasystest" cta requestermountrule add --instance root --name root --mountpolicy ctasystest --comment "ctasystest" diff --git a/continuousintegration/orchestration/tests/systest.sh b/continuousintegration/orchestration/tests/systest.sh index 4a35d7d390796b247771c020fa11feb8362d1b26..48945ccfecbab946df2b286a400e029d436d8163 100755 --- a/continuousintegration/orchestration/tests/systest.sh +++ b/continuousintegration/orchestration/tests/systest.sh @@ -96,7 +96,6 @@ echo "Preparing CTA for tests" --minarchiverequestage 1 \ --retrievepriority 1 \ --minretrieverequestage 1 \ - --maxdrivesallowed 1 \ --comment "ctasystest" kubectl --namespace ${NAMESPACE} exec ctacli -- cta requestermountrule add \ --instance ${EOSINSTANCE} \ diff --git a/continuousintegration/orchestration/tests/systest_xrdcp_many_concurrent_files.sh b/continuousintegration/orchestration/tests/systest_xrdcp_many_concurrent_files.sh index 4f7d493c2468d95ce7d725cd3bd6ce2bab901a5f..92e8207b504371bb42f846cc988ffbc7a68abd95 100755 --- a/continuousintegration/orchestration/tests/systest_xrdcp_many_concurrent_files.sh +++ b/continuousintegration/orchestration/tests/systest_xrdcp_many_concurrent_files.sh @@ -99,7 +99,6 @@ kubectl --namespace ${NAMESPACE} exec ctacli -- cta mountpolicy add \ --minarchiverequestage 1 \ --retrievepriority 1 \ --minretrieverequestage 1 \ - --maxdrivesallowed 1 \ --comment "ctasystest" kubectl --namespace ${NAMESPACE} exec ctacli -- cta requestermountrule add \ --instance ${EOSINSTANCE} \ diff --git a/continuousintegration/orchestration/tests/systest_xrdcp_many_files.sh b/continuousintegration/orchestration/tests/systest_xrdcp_many_files.sh index 96a507318e8206f3cac917abcd522007b44bbd2c..27ba8c1779f7b062cdf7a0ecc54a0ba377fcc946 100755 --- a/continuousintegration/orchestration/tests/systest_xrdcp_many_files.sh +++ b/continuousintegration/orchestration/tests/systest_xrdcp_many_files.sh @@ -97,7 +97,6 @@ kubectl --namespace ${NAMESPACE} exec ctacli -- cta mountpolicy add \ --minarchiverequestage 1 \ --retrievepriority 1 \ --minretrieverequestage 1 \ - --maxdrivesallowed 1 \ --comment "ctasystest" kubectl --namespace ${NAMESPACE} exec ctacli -- cta requestermountrule add \ --instance ${EOSINSTANCE} \ diff --git a/objectstore/AlgorithmsTest.cpp b/objectstore/AlgorithmsTest.cpp index fddefc71df48fa4df1af8d450fc84646d9b86d9d..8dfd318e384ec56668d2b5aee27a190794325d1a 100644 --- a/objectstore/AlgorithmsTest.cpp +++ b/objectstore/AlgorithmsTest.cpp @@ -90,7 +90,6 @@ void fillRetrieveRequests( rqc.mountPolicy.archivePriority = 1; rqc.mountPolicy.creationLog.time = time(nullptr); rqc.mountPolicy.lastModificationLog.time = time(nullptr); - rqc.mountPolicy.maxDrivesAllowed = 1; rqc.mountPolicy.retrieveMinRequestAge = 1; rqc.mountPolicy.retrievePriority = 1; requestPtrs.emplace_back(new cta::objectstore::RetrieveRequest(rrAddr, be)); diff --git a/objectstore/ArchiveQueue.cpp b/objectstore/ArchiveQueue.cpp index 28273ec3c093e16ca389a4771f4349fcb1d5ec7d..917a51b0feb72bc022fe118129ce2abdcaac7c3f 100644 --- a/objectstore/ArchiveQueue.cpp +++ b/objectstore/ArchiveQueue.cpp @@ -90,12 +90,10 @@ bool ArchiveQueue::checkMapsAndShardsCoherency() { totalJobs != jobsExpectedFromShardsPointers) return false; // Check that we have coherent queue summaries - ValueCountMapUint64 maxDriveAllowedMap(m_payload.mutable_maxdrivesallowedmap()); ValueCountMapUint64 priorityMap(m_payload.mutable_prioritymap()); ValueCountMapUint64 minArchiveRequestAgeMap(m_payload.mutable_minarchiverequestagemap()); ValueCountMapString mountPolicyNameMap(m_payload.mutable_mountpolicynamemap()); - if (maxDriveAllowedMap.total() != m_payload.archivejobscount() || - priorityMap.total() != m_payload.archivejobscount() || + if (priorityMap.total() != m_payload.archivejobscount() || minArchiveRequestAgeMap.total() != m_payload.archivejobscount() || mountPolicyNameMap.total() != m_payload.archivejobscount() ) @@ -116,8 +114,6 @@ void ArchiveQueue::rebuild() { std::list<std::unique_ptr<ArchiveQueueShard::AsyncLockfreeFetcher>> shardsFetchers; // Get the summaries structures ready - ValueCountMapUint64 maxDriveAllowedMap(m_payload.mutable_maxdrivesallowedmap()); - maxDriveAllowedMap.clear(); ValueCountMapUint64 priorityMap(m_payload.mutable_prioritymap()); priorityMap.clear(); ValueCountMapUint64 minArchiveRequestAgeMap(m_payload.mutable_minarchiverequestagemap()); @@ -158,7 +154,6 @@ void ArchiveQueue::rebuild() { size += j.size; priorityMap.incCount(j.priority); minArchiveRequestAgeMap.incCount(j.minArchiveRequestAge); - maxDriveAllowedMap.incCount(j.maxDrivesAllowed); mountPolicyNameMap.incCount(j.mountPolicyName); if (j.startTime < oldestJobCreationTime) oldestJobCreationTime = j.startTime; } @@ -380,13 +375,11 @@ void ArchiveQueue::addJobsAndCommit(std::list<JobToAdd> & jobsToAdd, AgentRefere { // As the queue could be rebuilt on each shard round, we get access to the // value maps here - ValueCountMapUint64 maxDriveAllowedMap(m_payload.mutable_maxdrivesallowedmap()); ValueCountMapUint64 priorityMap(m_payload.mutable_prioritymap()); ValueCountMapUint64 minArchiveRequestAgeMap(m_payload.mutable_minarchiverequestagemap()); ValueCountMapString mountPolicyNameMap(m_payload.mutable_mountpolicynamemap()); while (nextJob != jobsToAdd.end() && aqsp->shardjobscount() < c_maxShardSize) { // Update stats and global counters. - maxDriveAllowedMap.incCount(nextJob->policy.maxDrivesAllowed); priorityMap.incCount(nextJob->policy.archivePriority); minArchiveRequestAgeMap.incCount(nextJob->policy.archiveMinRequestAge); mountPolicyNameMap.incCount(nextJob->policy.name); @@ -425,8 +418,6 @@ auto ArchiveQueue::getJobsSummary() -> JobsSummary { ret.bytes = m_payload.archivejobstotalsize(); ret.oldestJobStartTime = m_payload.oldestjobcreationtime(); if (ret.jobs) { - ValueCountMapUint64 maxDriveAllowedMap(m_payload.mutable_maxdrivesallowedmap()); - ret.maxDrivesAllowed = maxDriveAllowedMap.maxValue(); ValueCountMapUint64 priorityMap(m_payload.mutable_prioritymap()); ret.priority = priorityMap.maxValue(); ValueCountMapUint64 minArchiveRequestAgeMap(m_payload.mutable_minarchiverequestagemap()); @@ -434,7 +425,6 @@ auto ArchiveQueue::getJobsSummary() -> JobsSummary { ValueCountMapString mountPolicyNameMap(m_payload.mutable_mountpolicynamemap()); ret.mountPolicyCountMap = mountPolicyNameMap.getMap(); } else { - ret.maxDrivesAllowed = 0; ret.priority = 0; ret.minArchiveRequestAge = 0; } @@ -494,7 +484,6 @@ ArchiveQueue::AdditionSummary ArchiveQueue::addJobsIfNecessaryAndCommit(std::lis void ArchiveQueue::removeJobsAndCommit(const std::list<std::string>& jobsToRemove) { checkPayloadWritable(); - ValueCountMapUint64 maxDriveAllowedMap(m_payload.mutable_maxdrivesallowedmap()); ValueCountMapUint64 priorityMap(m_payload.mutable_prioritymap()); ValueCountMapUint64 minArchiveRequestAgeMap(m_payload.mutable_minarchiverequestagemap()); ValueCountMapString mountPolicyNameMap(m_payload.mutable_mountpolicynamemap()); @@ -521,7 +510,6 @@ void ArchiveQueue::removeJobsAndCommit(const std::list<std::string>& jobsToRemov // We still need to update the tracking queue side. // Update stats and remove the jobs from the todo list. for (auto & j: removalResult.removedJobs) { - maxDriveAllowedMap.decCount(j.maxDrivesAllowed); priorityMap.decCount(j.priority); minArchiveRequestAgeMap.decCount(j.minArchiveRequestAge); mountPolicyNameMap.decCount(j.mountPolicyName); diff --git a/objectstore/ArchiveQueue.hpp b/objectstore/ArchiveQueue.hpp index 676f48672f7b2521e4f57c4754910843886516fe..456f7ea1992d14c684aa4b70fad7faa2464fdcae 100644 --- a/objectstore/ArchiveQueue.hpp +++ b/objectstore/ArchiveQueue.hpp @@ -101,7 +101,6 @@ public: time_t oldestJobStartTime; uint64_t priority; uint64_t minArchiveRequestAge; - uint64_t maxDrivesAllowed; std::map<std::string, uint64_t> mountPolicyCountMap; }; JobsSummary getJobsSummary(); diff --git a/objectstore/ArchiveQueueShard.cpp b/objectstore/ArchiveQueueShard.cpp index d7dab30aa044cd5895f090db547a099244b68423..8e566238fa5e2979f326c095df6c1f2748ff3304 100644 --- a/objectstore/ArchiveQueueShard.cpp +++ b/objectstore/ArchiveQueueShard.cpp @@ -97,7 +97,6 @@ auto ArchiveQueueShard::removeJobs(const std::list<std::string>& jobsToRemove) - ret.removedJobs.emplace_back(JobInfo()); ret.removedJobs.back().address = j.address(); ret.removedJobs.back().copyNb = j.copynb(); - ret.removedJobs.back().maxDrivesAllowed = j.maxdrivesallowed(); ret.removedJobs.back().minArchiveRequestAge = j.minarchiverequestage(); ret.removedJobs.back().priority = j.priority(); ret.removedJobs.back().size = j.size(); @@ -137,7 +136,7 @@ auto ArchiveQueueShard::dumpJobs() -> std::list<JobInfo> { std::list<JobInfo> ret; for (auto &j: m_payload.archivejobs()) { ret.emplace_back(JobInfo{j.size(), j.address(), (uint16_t)j.copynb(), j.priority(), - j.minarchiverequestage(), j.maxdrivesallowed(), (time_t)j.starttime(),j.mountpolicyname()}); + j.minarchiverequestage(), (time_t)j.starttime(),j.mountpolicyname()}); } return ret; } @@ -157,7 +156,6 @@ uint64_t ArchiveQueueShard::addJob(ArchiveQueue::JobToAdd& jobToAdd) { j->set_size(jobToAdd.fileSize); j->set_fileid(jobToAdd.archiveFileId); j->set_copynb(jobToAdd.job.copyNb); - j->set_maxdrivesallowed(jobToAdd.policy.maxDrivesAllowed); j->set_priority(jobToAdd.policy.archivePriority); j->set_minarchiverequestage(jobToAdd.policy.archiveMinRequestAge); j->set_starttime(jobToAdd.startTime); diff --git a/objectstore/ArchiveQueueShard.hpp b/objectstore/ArchiveQueueShard.hpp index ed86099337231db463ce79405b64c905fe65ce28..977b34b1d4fda9fc16af7b4e03c948c4da0d6d9d 100644 --- a/objectstore/ArchiveQueueShard.hpp +++ b/objectstore/ArchiveQueueShard.hpp @@ -50,7 +50,6 @@ public: uint32_t copyNb; uint64_t priority; uint64_t minArchiveRequestAge; - uint64_t maxDrivesAllowed; time_t startTime; std::string mountPolicyName; }; diff --git a/objectstore/GarbageCollectorTest.cpp b/objectstore/GarbageCollectorTest.cpp index 3acbd579984a87d3c159995b1bfa25b8657b0104..9186f331ec97ab9e4231aa7be9f917a3b5481d43 100644 --- a/objectstore/GarbageCollectorTest.cpp +++ b/objectstore/GarbageCollectorTest.cpp @@ -394,7 +394,6 @@ TEST(ObjectStore, GarbageCollectorArchiveRequest) { cta::common::dataStructures::MountPolicy policy; policy.archiveMinRequestAge = 0; policy.archivePriority = 1; - policy.maxDrivesAllowed = 1; std::list <cta::objectstore::ArchiveQueue::JobToAdd> jta; jta.push_back({jd, ar.getAddressIfSet(), ar.getArchiveFile().archiveFileID, 1000U+pass, policy, time(NULL)}); aq.addJobsAndCommit(jta, agentRef, lc); @@ -415,7 +414,6 @@ TEST(ObjectStore, GarbageCollectorArchiveRequest) { cta::common::dataStructures::MountPolicy policy; policy.archiveMinRequestAge = 0; policy.archivePriority = 1; - policy.maxDrivesAllowed = 1; std::list <cta::objectstore::ArchiveQueue::JobToAdd> jta; jta.push_back({jd, ar.getAddressIfSet(), ar.getArchiveFile().archiveFileID, 1000+pass, policy, time(NULL)}); aq.addJobsAndCommit(jta, agentRef, lc); @@ -582,7 +580,6 @@ TEST(ObjectStore, GarbageCollectorRetrieveRequest) { rqc.mountPolicy.archivePriority = 1; rqc.mountPolicy.creationLog.time = time(nullptr); rqc.mountPolicy.lastModificationLog.time = time(nullptr); - rqc.mountPolicy.maxDrivesAllowed = 1; rqc.mountPolicy.retrieveMinRequestAge = 1; rqc.mountPolicy.retrievePriority = 1; rr.setRetrieveFileQueueCriteria(rqc); @@ -1170,7 +1167,6 @@ TEST(ObjectStore, GarbageCollectorRetrieveAllStatusesAndQueues) { rqc.mountPolicy.archivePriority = 1; rqc.mountPolicy.creationLog.time = time(nullptr); rqc.mountPolicy.lastModificationLog.time = time(nullptr); - rqc.mountPolicy.maxDrivesAllowed = 1; rqc.mountPolicy.retrieveMinRequestAge = 1; rqc.mountPolicy.retrievePriority = 1; rr.setRetrieveFileQueueCriteria(rqc); @@ -1639,7 +1635,6 @@ TEST(ObjectStore, GarbageCollectorRetrieveRequestRepackDisabledTape){ rqc.mountPolicy.archivePriority = 1; rqc.mountPolicy.creationLog.time = time(nullptr); rqc.mountPolicy.lastModificationLog.time = time(nullptr); - rqc.mountPolicy.maxDrivesAllowed = 1; rqc.mountPolicy.retrieveMinRequestAge = 1; rqc.mountPolicy.retrievePriority = 1; rr.setRetrieveFileQueueCriteria(rqc); diff --git a/objectstore/MountPolicySerDeser.hpp b/objectstore/MountPolicySerDeser.hpp index f64950c60294f52faf17be7672f5de2b7e85181d..d2c1f7060a89dd744e2cb9d3971a70a1a1fd7060 100644 --- a/objectstore/MountPolicySerDeser.hpp +++ b/objectstore/MountPolicySerDeser.hpp @@ -42,7 +42,6 @@ public: osmp.set_archiveminrequestage(archiveMinRequestAge); osmp.set_retrievepriority(retrievePriority); osmp.set_retieveminrequestage(retrieveMinRequestAge); - osmp.set_maxdrivesallowed(maxDrivesAllowed); EntryLogSerDeser(creationLog).serialize(*osmp.mutable_creationlog()); EntryLogSerDeser(lastModificationLog).serialize(*osmp.mutable_lastmodificationlog()); osmp.set_comment(comment); @@ -53,7 +52,6 @@ public: archiveMinRequestAge=osmp.archiveminrequestage(); retrievePriority=osmp.retrievepriority(); retrieveMinRequestAge=osmp.retieveminrequestage(); - maxDrivesAllowed=osmp.maxdrivesallowed(); EntryLogSerDeser el; el.deserialize(osmp.creationlog()); creationLog=el; diff --git a/objectstore/RetrieveQueue.cpp b/objectstore/RetrieveQueue.cpp index b442f54ccb063b72660b3c01fce4fd86aedbbb67..e20348cee417b32298d22a4c4bfbefc7302c361c 100644 --- a/objectstore/RetrieveQueue.cpp +++ b/objectstore/RetrieveQueue.cpp @@ -69,12 +69,10 @@ bool RetrieveQueue::checkMapsAndShardsCoherency() { totalJobs != jobsExpectedFromShardsPointers) return false; // Check that we have coherent queue summaries - ValueCountMapUint64 maxDriveAllowedMap(m_payload.mutable_maxdrivesallowedmap()); ValueCountMapUint64 priorityMap(m_payload.mutable_prioritymap()); ValueCountMapUint64 minRetrieveRequestAgeMap(m_payload.mutable_minretrieverequestagemap()); ValueCountMapString mountPolicyNameMap(m_payload.mutable_mountpolicynamemap()); - if (maxDriveAllowedMap.total() != m_payload.retrievejobscount() || - priorityMap.total() != m_payload.retrievejobscount() || + if (priorityMap.total() != m_payload.retrievejobscount() || minRetrieveRequestAgeMap.total() != m_payload.retrievejobscount() || mountPolicyNameMap.total() != m_payload.retrievejobscount() ) @@ -95,8 +93,6 @@ void RetrieveQueue::rebuild() { std::list<std::unique_ptr<RetrieveQueueShard::AsyncLockfreeFetcher>> shardsFetchers; // Get the summaries structures ready - ValueCountMapUint64 maxDriveAllowedMap(m_payload.mutable_maxdrivesallowedmap()); - maxDriveAllowedMap.clear(); ValueCountMapUint64 priorityMap(m_payload.mutable_prioritymap()); priorityMap.clear(); ValueCountMapUint64 minRetrieveRequestAgeMap(m_payload.mutable_minretrieverequestagemap()); @@ -139,7 +135,6 @@ void RetrieveQueue::rebuild() { size += j.size; priorityMap.incCount(j.priority); minRetrieveRequestAgeMap.incCount(j.minRetrieveRequestAge); - maxDriveAllowedMap.incCount(j.maxDrivesAllowed); mountPolicyNameMap.incCount(j.mountPolicyName); if (j.startTime < oldestJobCreationTime) oldestJobCreationTime = j.startTime; if (j.fSeq < minFseq) minFseq = j.fSeq; @@ -304,7 +299,6 @@ void RetrieveQueue::addJobsAndCommit(std::list<JobToAdd> & jobsToAdd, AgentRefer checkPayloadWritable(); if (jobsToAdd.empty()) return; // Keep track of the mounting criteria - ValueCountMapUint64 maxDriveAllowedMap(m_payload.mutable_maxdrivesallowedmap()); ValueCountMapUint64 priorityMap(m_payload.mutable_prioritymap()); ValueCountMapUint64 minRetrieveRequestAgeMap(m_payload.mutable_minretrieverequestagemap()); ValueCountMapString mountPolicyNameMap(m_payload.mutable_mountpolicynamemap()); @@ -481,7 +475,6 @@ void RetrieveQueue::addJobsAndCommit(std::list<JobToAdd> & jobsToAdd, AgentRefer jtas.insert(j); addedJobs++; addedBytes+=j.fileSize; - maxDriveAllowedMap.incCount(j.policy.maxDrivesAllowed); priorityMap.incCount(j.policy.retrievePriority); minRetrieveRequestAgeMap.incCount(j.policy.retrieveMinRequestAge); mountPolicyNameMap.incCount(j.policy.name); @@ -588,8 +581,6 @@ RetrieveQueue::JobsSummary RetrieveQueue::getJobsSummary() { ret.jobs = m_payload.retrievejobscount(); ret.oldestJobStartTime = m_payload.oldestjobcreationtime(); if (ret.jobs) { - ValueCountMapUint64 maxDriveAllowedMap(m_payload.mutable_maxdrivesallowedmap()); - ret.maxDrivesAllowed = maxDriveAllowedMap.maxValue(); ValueCountMapUint64 priorityMap(m_payload.mutable_prioritymap()); ret.priority = priorityMap.maxValue(); ValueCountMapUint64 minRetrieveRequestAgeMap(m_payload.mutable_minretrieverequestagemap()); @@ -608,7 +599,6 @@ RetrieveQueue::JobsSummary RetrieveQueue::getJobsSummary() { ret.sleepInfo = si; } } else { - ret.maxDrivesAllowed = 0; ret.priority = 0; ret.minRetrieveRequestAge = 0; } @@ -683,7 +673,6 @@ auto RetrieveQueue::getCandidateSummary() -> CandidateJobList { void RetrieveQueue::removeJobsAndCommit(const std::list<std::string>& jobsToRemove) { checkPayloadWritable(); - ValueCountMapUint64 maxDriveAllowedMap(m_payload.mutable_maxdrivesallowedmap()); ValueCountMapUint64 priorityMap(m_payload.mutable_prioritymap()); ValueCountMapUint64 minRetrieveRequestAgeMap(m_payload.mutable_minretrieverequestagemap()); ValueCountMapString mountPolicyNameMap(m_payload.mutable_mountpolicynamemap()); @@ -713,7 +702,6 @@ void RetrieveQueue::removeJobsAndCommit(const std::list<std::string>& jobsToRemo bool needToRebuild = false; time_t oldestJobCreationTime = m_payload.oldestjobcreationtime(); for (auto & j: removalResult.removedJobs) { - maxDriveAllowedMap.decCount(j.maxDrivesAllowed); priorityMap.decCount(j.priority); minRetrieveRequestAgeMap.decCount(j.minRetrieveRequestAge); mountPolicyNameMap.decCount(j.mountPolicyName); diff --git a/objectstore/RetrieveQueue.hpp b/objectstore/RetrieveQueue.hpp index 3541a55eb2c585d1ee7eba2eb9f0ec1e46addf44..314300550bec42a1d4f5a109d17d4dd9b74db8fd 100644 --- a/objectstore/RetrieveQueue.hpp +++ b/objectstore/RetrieveQueue.hpp @@ -84,7 +84,6 @@ public: time_t oldestJobStartTime; uint64_t priority; uint64_t minRetrieveRequestAge; - uint64_t maxDrivesAllowed; std::map<std::string, uint64_t> mountPolicyCountMap; struct ActivityCount { std::string diskInstanceName; diff --git a/objectstore/RetrieveQueueAlgorithms.hpp b/objectstore/RetrieveQueueAlgorithms.hpp index 18e7f27cfb7aa20c3d7d5fd33d3777ca2cfae3a8..8537a7f21b2ebd1b7e2a90606651473824d14e52 100644 --- a/objectstore/RetrieveQueueAlgorithms.hpp +++ b/objectstore/RetrieveQueueAlgorithms.hpp @@ -31,7 +31,7 @@ struct ContainerTraits<RetrieveQueue,C> ContainerSummary() : RetrieveQueue::JobsSummary() {} ContainerSummary(const RetrieveQueue::JobsSummary &c) : RetrieveQueue::JobsSummary({c.jobs,c.bytes,c.oldestJobStartTime,c.priority, - c.minRetrieveRequestAge,c.maxDrivesAllowed,c.mountPolicyCountMap,c.activityCounts,nullopt}) {} + c.minRetrieveRequestAge,c.mountPolicyCountMap,c.activityCounts,nullopt}) {} void addDeltaToLog(const ContainerSummary&, log::ScopedParamContainer&) const; }; diff --git a/objectstore/RetrieveQueueShard.cpp b/objectstore/RetrieveQueueShard.cpp index a764f29ab0b3ac9ec6dd300cccd58345be66cf7b..6ce01506e06e91621bfdb7c5f1a70a17a4f7dfae 100644 --- a/objectstore/RetrieveQueueShard.cpp +++ b/objectstore/RetrieveQueueShard.cpp @@ -107,7 +107,6 @@ auto RetrieveQueueShard::removeJobs(const std::list<std::string>& jobsToRemove) ret.removedJobs.back().address = j.address(); ret.removedJobs.back().fSeq = j.fseq(); ret.removedJobs.back().copyNb = j.copynb(); - ret.removedJobs.back().maxDrivesAllowed = j.maxdrivesallowed(); ret.removedJobs.back().minRetrieveRequestAge = j.minretrieverequestage(); ret.removedJobs.back().priority = j.priority(); ret.removedJobs.back().mountPolicyName = j.mountpolicyname(); @@ -151,7 +150,7 @@ auto RetrieveQueueShard::dumpJobs() -> std::list<JobInfo> { std::list<JobInfo> ret; for (auto &j: m_payload.retrievejobs()) { ret.emplace_back(JobInfo{j.size(), j.address(), (uint16_t)j.copynb(), j.priority(), - j.minretrieverequestage(), j.maxdrivesallowed(), (time_t)j.starttime(), j.fseq(), j.mountpolicyname(), nullopt, nullopt}); + j.minretrieverequestage(), (time_t)j.starttime(), j.fseq(), j.mountpolicyname(), nullopt, nullopt}); if (j.has_activity()) { ret.back().activityDescription = RetrieveQueue::JobDump::ActivityDescription{ j.disk_instance_name(), j.activity() }; } @@ -171,7 +170,6 @@ std::list<RetrieveQueue::JobToAdd> RetrieveQueueShard::dumpJobsToAdd() { ret.back().fSeq = j.fseq(); ret.back().fileSize = j.size(); ret.back().policy.retrieveMinRequestAge = j.minretrieverequestage(); - ret.back().policy.maxDrivesAllowed = j.maxdrivesallowed(); ret.back().policy.retrievePriority = j.priority(); ret.back().policy.name = j.mountpolicyname(); ret.back().startTime = j.starttime(); @@ -279,7 +277,6 @@ void RetrieveQueueShard::addJob(const RetrieveQueue::JobToAdd& jobToAdd) { j->set_copynb(jobToAdd.copyNb); j->set_fseq(jobToAdd.fSeq); j->set_starttime(jobToAdd.startTime); - j->set_maxdrivesallowed(jobToAdd.policy.maxDrivesAllowed); j->set_priority(jobToAdd.policy.retrievePriority); j->set_minretrieverequestage(jobToAdd.policy.retrieveMinRequestAge); j->set_mountpolicyname(jobToAdd.policy.name); @@ -317,7 +314,6 @@ void RetrieveQueueShard::addJobsThroughCopy(JobsToAddSet& jobsToAdd) { rjp.set_copynb(jobToAdd.copyNb); rjp.set_fseq(jobToAdd.fSeq); rjp.set_starttime(jobToAdd.startTime); - rjp.set_maxdrivesallowed(jobToAdd.policy.maxDrivesAllowed); rjp.set_priority(jobToAdd.policy.retrievePriority); rjp.set_minretrieverequestage(jobToAdd.policy.retrieveMinRequestAge); rjp.set_mountpolicyname(jobToAdd.policy.name); diff --git a/objectstore/RetrieveQueueShard.hpp b/objectstore/RetrieveQueueShard.hpp index ac67b90812ac6a22dd7cb015654ed5cf83a6f0c2..42799b5e019ad5e764d1baa0f07efb888da359a1 100644 --- a/objectstore/RetrieveQueueShard.hpp +++ b/objectstore/RetrieveQueueShard.hpp @@ -50,7 +50,6 @@ public: uint32_t copyNb; uint64_t priority; uint64_t minRetrieveRequestAge; - uint64_t maxDrivesAllowed; time_t startTime; uint64_t fSeq; std::string mountPolicyName; diff --git a/objectstore/RetrieveQueueTest.cpp b/objectstore/RetrieveQueueTest.cpp index aa7d386797eae835bccd7a8954eaf32a7c1a7916..36e33e4188ed75b63a7693e1ed3d736ba15c6d83 100644 --- a/objectstore/RetrieveQueueTest.cpp +++ b/objectstore/RetrieveQueueTest.cpp @@ -68,7 +68,6 @@ TEST(ObjectStore, RetrieveQueueShardingAndOrderingTest) { jta.copyNb = 1; jta.fSeq = i; jta.fileSize = 1000; - jta.policy.maxDrivesAllowed = 10; jta.policy.retrieveMinRequestAge = 10; jta.policy.retrievePriority = 1; jta.startTime = ::time(nullptr); @@ -169,7 +168,6 @@ TEST(ObjectStore, RetrieveQueueActivityCounts) { jta.copyNb = 1; jta.fSeq = i; jta.fileSize = 1000; - jta.policy.maxDrivesAllowed = 10; jta.policy.retrieveMinRequestAge = 10; jta.policy.retrievePriority = 1; jta.startTime = ::time(nullptr); diff --git a/objectstore/SorterTest.cpp b/objectstore/SorterTest.cpp index 13f63a0e61f544fd59b40d3dd6ac0bbf94805e43..c41a0cd7aaa5cfc600f60f4f2ae7b9d5d814565f 100644 --- a/objectstore/SorterTest.cpp +++ b/objectstore/SorterTest.cpp @@ -259,7 +259,6 @@ TEST(ObjectStore,SorterInsertRetrieveRequest){ rqc.mountPolicy.archivePriority = 1; rqc.mountPolicy.creationLog.time = time(nullptr); rqc.mountPolicy.lastModificationLog.time = time(nullptr); - rqc.mountPolicy.maxDrivesAllowed = 1; rqc.mountPolicy.retrieveMinRequestAge = 1; rqc.mountPolicy.retrievePriority = 1; rr.setRetrieveFileQueueCriteria(rqc); @@ -459,7 +458,6 @@ TEST(ObjectStore,SorterInsertDifferentTypesOfRequests){ rqc.mountPolicy.archivePriority = 1; rqc.mountPolicy.creationLog.time = time(nullptr); rqc.mountPolicy.lastModificationLog.time = time(nullptr); - rqc.mountPolicy.maxDrivesAllowed = 1; rqc.mountPolicy.retrieveMinRequestAge = 1; rqc.mountPolicy.retrievePriority = 1; rr.setRetrieveFileQueueCriteria(rqc); @@ -501,7 +499,6 @@ TEST(ObjectStore,SorterInsertDifferentTypesOfRequests){ rqc2.mountPolicy.archivePriority = 1; rqc2.mountPolicy.creationLog.time = time(nullptr); rqc2.mountPolicy.lastModificationLog.time = time(nullptr); - rqc2.mountPolicy.maxDrivesAllowed = 1; rqc2.mountPolicy.retrieveMinRequestAge = 1; rqc2.mountPolicy.retrievePriority = 1; rr2.setRetrieveFileQueueCriteria(rqc2); @@ -907,7 +904,6 @@ TEST(ObjectStore,SorterInsertRetrieveRequestNotFetched){ rqc.mountPolicy.archivePriority = 1; rqc.mountPolicy.creationLog.time = time(nullptr); rqc.mountPolicy.lastModificationLog.time = time(nullptr); - rqc.mountPolicy.maxDrivesAllowed = 1; rqc.mountPolicy.retrieveMinRequestAge = 1; rqc.mountPolicy.retrievePriority = 1; rr.setRetrieveFileQueueCriteria(rqc); diff --git a/objectstore/cta.proto b/objectstore/cta.proto index e7e0f65ca0717d6792f5f2ca3bc9e86df1fff194..f69e560206bde4c11bc056887030bf2121e345e8 100644 --- a/objectstore/cta.proto +++ b/objectstore/cta.proto @@ -296,7 +296,6 @@ message MountPolicy { required uint64 archiveminrequestage = 8982; required uint64 retrievepriority = 8983; required uint64 retieveminrequestage = 8984; - required uint64 maxdrivesallowed = 8985; required EntryLog creationlog = 8986; required EntryLog lastmodificationlog = 8987; required string comment = 8988; @@ -477,7 +476,6 @@ message ArchiveJobPointer { required uint32 copynb = 3003; required uint64 priority = 3004; required uint64 minarchiverequestage = 3005; - required uint64 maxdrivesallowed = 3006; required uint64 starttime = 3007; required string mountpolicyname = 3008; } @@ -498,7 +496,6 @@ message ArchiveQueue { repeated ArchiveQueueShardPointer archivequeueshards = 10010; repeated ValueCountPair prioritymap = 10031; repeated ValueCountPair minarchiverequestagemap = 10032; - repeated ValueCountPair maxdrivesallowedmap = 10033; repeated StringCountPair mountpolicynamemap = 10034; required uint64 archivejobstotalsize = 10040; required uint64 archivejobscount = 10045; @@ -514,7 +511,6 @@ message RetrieveJobPointer { required uint64 fseq = 3107; required uint64 priority = 3104; required uint64 minretrieverequestage = 3105; - required uint64 maxdrivesallowed = 3106; required uint64 starttime = 3108; required string mountpolicyname = 3112; // For activity (if present), we need disk instance and activity name (priority is always provided) @@ -546,7 +542,6 @@ message RetrieveQueue { repeated RetrieveQueueShardPointer retrievequeueshards = 10111; repeated ValueCountPair prioritymap = 10131; repeated ValueCountPair minretrieverequestagemap = 10132; - repeated ValueCountPair maxdrivesallowedmap = 10133; repeated StringCountPair mountpolicynamemap = 10134; repeated RetrieveActivityCountPair activity_map = 10136; required uint64 retrievejobstotalsize = 10140; diff --git a/scheduler/OStoreDB/OStoreDB.cpp b/scheduler/OStoreDB/OStoreDB.cpp index 4c79801ab78a2b7c62cf07cd28bb032aa449796d..e937aa2963e1c854c809a8301754830d6e579801 100644 --- a/scheduler/OStoreDB/OStoreDB.cpp +++ b/scheduler/OStoreDB/OStoreDB.cpp @@ -548,9 +548,6 @@ common::dataStructures::MountPolicy OStoreDB::createBestArchiveMountPolicy(const if(mp1.archiveMinRequestAge < mp2.archiveMinRequestAge){ mp.archiveMinRequestAge = mp1.archiveMinRequestAge; } - if(mp1.maxDrivesAllowed > mp2.maxDrivesAllowed){ - mp.maxDrivesAllowed = mp1.maxDrivesAllowed; - } return mp; }); return bestMountPolicy; @@ -573,9 +570,6 @@ common::dataStructures::MountPolicy OStoreDB::createBestRetrieveMountPolicy(cons if(mp1.retrieveMinRequestAge < mp2.retrieveMinRequestAge){ mp.retrieveMinRequestAge = mp1.retrieveMinRequestAge; } - if(mp1.maxDrivesAllowed > mp2.maxDrivesAllowed){ - mp.maxDrivesAllowed = mp1.maxDrivesAllowed; - } return mp; }); return bestMountPolicy; diff --git a/scheduler/OStoreDB/OStoreDB.hpp b/scheduler/OStoreDB/OStoreDB.hpp index 51c4242bb9db5b18a2e2d6e048c255666dd1fd81..d709b340b67e29f72a14c7906347358825d74070 100644 --- a/scheduler/OStoreDB/OStoreDB.hpp +++ b/scheduler/OStoreDB/OStoreDB.hpp @@ -161,7 +161,7 @@ private: /** * Return the best archive mount policy from the mountPolicies passed in parameter - * The aim is to do the same as ArchiveQueue::getJobsSummary() regarding the priority, maxDrivesAllowed, minArchiveRequestAge attributes of the queue + * The aim is to do the same as ArchiveQueue::getJobsSummary() regarding the priority, minArchiveRequestAge attributes of the queue * @param mountPolicies the list of mount policies in order to create the best one. * @return the best archive mount policy to use */ @@ -169,7 +169,7 @@ private: /** * Return the best retrieve mount policy from the mountPolicies passed in parameter - * The aim is to do the same as RetrieveQueue::getJobsSummary() regarding the priority, maxDrivesAllowed, minArchiveRequestAge attributes of the queue + * The aim is to do the same as RetrieveQueue::getJobsSummary() regarding the priority, minArchiveRequestAge attributes of the queue * @param mountPolicies the list of mount policies in order to create the best one. * @return the best retrieve mount policy to use */ diff --git a/scheduler/OStoreDB/OStoreDBTest.cpp b/scheduler/OStoreDB/OStoreDBTest.cpp index b9d12786d8102a2b0a5ca682b96e6996cdb67aed..7a146e24185a17cffd2e279038e3c376f154c4ff 100644 --- a/scheduler/OStoreDB/OStoreDBTest.cpp +++ b/scheduler/OStoreDB/OStoreDBTest.cpp @@ -134,7 +134,6 @@ TEST_P(OStoreDBTest, getBatchArchiveJob) { afqc.mountPolicy.retrieveMinRequestAge = 1; afqc.mountPolicy.retrievePriority = 1; afqc.mountPolicy.retrieveMinRequestAge = 1; - afqc.mountPolicy.maxDrivesAllowed = 1; osdbi.queueArchive("testInstance", ar, afqc, lc); osdbi.waitSubthreadsComplete(); } diff --git a/scheduler/Scheduler.cpp b/scheduler/Scheduler.cpp index ad4ab588fe00588e958ad1f4d03283ef4a72179e..6ba67060ee7b0c9fd2cdbaab24ae9c696196ea8e 100644 --- a/scheduler/Scheduler.cpp +++ b/scheduler/Scheduler.cpp @@ -161,7 +161,6 @@ std::string Scheduler::queueArchiveWithGivenId(const uint64_t archiveFileId, con spc.add("policyName", catalogueInfo.mountPolicy.name) .add("policyArchiveMinAge", catalogueInfo.mountPolicy.archiveMinRequestAge) .add("policyArchivePriority", catalogueInfo.mountPolicy.archivePriority) - .add("policyMaxDrives", catalogueInfo.mountPolicy.maxDrivesAllowed) .add("diskFilePath", request.diskFileInfo.path) .add("diskFileOwnerUid", request.diskFileInfo.owner_uid) .add("diskFileGid", request.diskFileInfo.gid) @@ -247,7 +246,6 @@ std::string Scheduler::queueRetrieve( .add("catalogueTime", catalogueTime) .add("schedulerDbTime", schedulerDbTime) .add("policyName", queueCriteria.mountPolicy.name) - .add("policyMaxDrives", queueCriteria.mountPolicy.maxDrivesAllowed) .add("policyMinAge", queueCriteria.mountPolicy.retrieveMinRequestAge) .add("policyPriority", queueCriteria.mountPolicy.retrievePriority) .add("retrieveRequestId", requestInfo.requestId); diff --git a/scheduler/SchedulerDatabaseTest.cpp b/scheduler/SchedulerDatabaseTest.cpp index 8b5acc5d3183ae2657e68ab912fa18c4838e1068..865a209e7a9d3afad3d32a88c423f86a21e05800 100644 --- a/scheduler/SchedulerDatabaseTest.cpp +++ b/scheduler/SchedulerDatabaseTest.cpp @@ -166,7 +166,6 @@ TEST_P(SchedulerDatabaseTest, createManyArchiveJobs) { afqc.mountPolicy.archiveMinRequestAge = 0; afqc.mountPolicy.retrievePriority = 1; afqc.mountPolicy.retrieveMinRequestAge = 0; - afqc.mountPolicy.maxDrivesAllowed = 10; afqc.mountPolicy.creationLog = { "u", "h", time(nullptr)}; afqc.mountPolicy.lastModificationLog = { "u", "h", time(nullptr)}; afqc.mountPolicy.comment = "comment"; @@ -246,7 +245,6 @@ TEST_P(SchedulerDatabaseTest, createManyArchiveJobs) { afqc.mountPolicy.archiveMinRequestAge = 0; afqc.mountPolicy.retrievePriority = 1; afqc.mountPolicy.retrieveMinRequestAge = 0; - afqc.mountPolicy.maxDrivesAllowed = 10; afqc.mountPolicy.creationLog = { "u", "h", time(nullptr)}; afqc.mountPolicy.lastModificationLog = { "u", "h", time(nullptr)}; afqc.mountPolicy.comment = "comment"; @@ -343,7 +341,6 @@ TEST_P(SchedulerDatabaseTest, popRetrieveRequestsWithDisksytem) { rfqc.mountPolicy.archiveMinRequestAge = 0; rfqc.mountPolicy.retrievePriority = 1; rfqc.mountPolicy.retrieveMinRequestAge = 0; - rfqc.mountPolicy.maxDrivesAllowed = 10; rfqc.mountPolicy.creationLog = { "u", "h", time(nullptr)}; rfqc.mountPolicy.lastModificationLog = { "u", "h", time(nullptr)}; rfqc.mountPolicy.comment = "comment"; @@ -430,7 +427,6 @@ TEST_P(SchedulerDatabaseTest, popRetrieveRequestsWithBackpressure) { rfqc.mountPolicy.archiveMinRequestAge = 0; rfqc.mountPolicy.retrievePriority = 1; rfqc.mountPolicy.retrieveMinRequestAge = 0; - rfqc.mountPolicy.maxDrivesAllowed = 10; rfqc.mountPolicy.creationLog = { "u", "h", time(nullptr)}; rfqc.mountPolicy.lastModificationLog = { "u", "h", time(nullptr)}; rfqc.mountPolicy.comment = "comment"; @@ -531,7 +527,6 @@ TEST_P(SchedulerDatabaseTest, popRetrieveRequestsWithDiskSystemNotFetcheable) { rfqc.mountPolicy.archiveMinRequestAge = 0; rfqc.mountPolicy.retrievePriority = 1; rfqc.mountPolicy.retrieveMinRequestAge = 0; - rfqc.mountPolicy.maxDrivesAllowed = 10; rfqc.mountPolicy.creationLog = { "u", "h", time(nullptr)}; rfqc.mountPolicy.lastModificationLog = { "u", "h", time(nullptr)}; rfqc.mountPolicy.comment = "comment"; diff --git a/scheduler/SchedulerTest.cpp b/scheduler/SchedulerTest.cpp index 3ac9caa03876913ebdf00a515305393a7d85813b..0b7660378653ee6f71a583f0048bdbcde1355411 100644 --- a/scheduler/SchedulerTest.cpp +++ b/scheduler/SchedulerTest.cpp @@ -167,7 +167,6 @@ public: const uint64_t minArchiveRequestAge = s_minArchiveRequestAge; const uint64_t retrievePriority = s_retrievePriority; const uint64_t minRetrieveRequestAge = s_minRetrieveRequestAge; - const uint64_t maxDrivesAllowed = s_maxDrivesAllowed; const std::string mountPolicyComment = "create mount group"; catalogue::CreateMountPolicyAttributes mountPolicy; @@ -176,7 +175,6 @@ public: mountPolicy.minArchiveRequestAge = minArchiveRequestAge; mountPolicy.retrievePriority = retrievePriority; mountPolicy.minRetrieveRequestAge = minRetrieveRequestAge; - mountPolicy.maxDrivesAllowed = maxDrivesAllowed; mountPolicy.comment = mountPolicyComment; ASSERT_TRUE(catalogue.getMountPolicies().empty()); @@ -193,7 +191,6 @@ public: ASSERT_EQ(minArchiveRequestAge, group.archiveMinRequestAge); ASSERT_EQ(retrievePriority, group.retrievePriority); ASSERT_EQ(minRetrieveRequestAge, group.retrieveMinRequestAge); - ASSERT_EQ(maxDrivesAllowed, group.maxDrivesAllowed); ASSERT_EQ(mountPolicyComment, group.comment); const std::string ruleComment = "create requester mount-rule"; @@ -293,7 +290,6 @@ protected: const uint64_t s_minArchiveRequestAge = 2; const uint64_t s_retrievePriority = 3; const uint64_t s_minRetrieveRequestAge = 4; - const uint64_t s_maxDrivesAllowed = 50; const uint64_t s_mediaTypeCapacityInBytes = 10; const std::string s_vo = "vo"; //TempFile m_tempSqliteFile; @@ -4023,7 +4019,6 @@ TEST_P(SchedulerTest, getNextMountEmptyArchiveForRepackIfNbFilesQueuedIsLessThan ar->setJobStatus(1, serializers::ArchiveJobStatus::AJS_ToTransferForRepack); cta::common::dataStructures::MountPolicy mp; mp.archiveMinRequestAge = 250000; - mp.maxDrivesAllowed = 1; ar->setMountPolicy(mp); ar->setArchiveReportURL(""); ar->setArchiveErrorReportURL(""); @@ -4058,7 +4053,6 @@ TEST_P(SchedulerTest, getNextMountEmptyArchiveForRepackIfNbFilesQueuedIsLessThan ar->setJobStatus(1, serializers::ArchiveJobStatus::AJS_ToTransferForRepack); cta::common::dataStructures::MountPolicy mp; mp.archiveMinRequestAge = 250000; - mp.maxDrivesAllowed = 1; ar->setMountPolicy(mp); ar->setArchiveReportURL(""); ar->setArchiveErrorReportURL(""); @@ -4849,10 +4843,10 @@ TEST_P(SchedulerTest, archiveMaxDrivesVoInFlightChangeScheduleMount){ scheduler.reportDriveStatus(driveInfo, cta::common::dataStructures::MountType::NoMount, cta::common::dataStructures::DriveStatus::Down, lc); scheduler.reportDriveStatus(driveInfo, cta::common::dataStructures::MountType::NoMount, cta::common::dataStructures::DriveStatus::Up, lc); bool nextMount = scheduler.getNextMountDryRun(s_libraryName, driveName, lc); - //nextMount should be false as the maxDrivesAllowed is 0 + //nextMount should be false as the VO write max drives is 0 ASSERT_FALSE(nextMount); catalogue.modifyVirtualOrganizationWriteMaxDrives(s_adminOnAdminHost,s_vo,1); - //Reset the maxDrivesAllowed to a positive number should give a new mount + //Reset the VO write max drives to a positive number should give a new mount nextMount = scheduler.getNextMountDryRun(s_libraryName,driveName,lc); ASSERT_TRUE(nextMount); } diff --git a/tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp b/tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp index 3771412bc27fc5d3b00fe18b12ec26d67c2dac39..973f54f93f5d9200971b3d2c2567c73e8341fa97 100644 --- a/tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp +++ b/tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp @@ -259,7 +259,6 @@ public: mountPolicy.minArchiveRequestAge = 2; mountPolicy.retrievePriority = 3; mountPolicy.minRetrieveRequestAge = 4; - mountPolicy.maxDrivesAllowed = 5; mountPolicy.comment = "create mount group"; return mountPolicy; } @@ -271,7 +270,6 @@ public: mountPolicy.minArchiveRequestAge = 0; mountPolicy.retrievePriority = 1000; mountPolicy.minRetrieveRequestAge = 0; - mountPolicy.maxDrivesAllowed = 1; mountPolicy.comment = "Immediate mount"; return mountPolicy; } @@ -296,7 +294,6 @@ public: const uint64_t minArchiveRequestAge = mountPolicy.minArchiveRequestAge; const uint64_t retrievePriority = mountPolicy.retrievePriority; const uint64_t minRetrieveRequestAge = mountPolicy.minRetrieveRequestAge; - const uint64_t maxDrivesAllowed = mountPolicy.maxDrivesAllowed; const std::string mountPolicyComment = "create mount group"; ASSERT_TRUE(catalogue.getMountPolicies().empty()); @@ -313,7 +310,6 @@ public: ASSERT_EQ(minArchiveRequestAge, group.archiveMinRequestAge); ASSERT_EQ(retrievePriority, group.retrievePriority); ASSERT_EQ(minRetrieveRequestAge, group.retrieveMinRequestAge); - ASSERT_EQ(maxDrivesAllowed, group.maxDrivesAllowed); ASSERT_EQ(mountPolicyComment, group.comment); const std::string ruleComment = "create requester mount-rule"; diff --git a/xroot_plugins/XrdCtaMountPolicyLs.hpp b/xroot_plugins/XrdCtaMountPolicyLs.hpp index 084bad6086ac3926fdf0cd67e6059a3f82c579f9..2830a08ee8cc058c7414de9d890389ac7346410b 100644 --- a/xroot_plugins/XrdCtaMountPolicyLs.hpp +++ b/xroot_plugins/XrdCtaMountPolicyLs.hpp @@ -78,7 +78,6 @@ int MountPolicyLsStream::fillBuffer(XrdSsiPb::OStreamBuffer<Data> *streambuf) { mp_item->set_archive_min_request_age(mp.archiveMinRequestAge); mp_item->set_retrieve_priority(mp.retrievePriority); mp_item->set_retrieve_min_request_age(mp.retrieveMinRequestAge); - mp_item->set_max_drives_allowed(mp.maxDrivesAllowed); mp_item->mutable_creation_log()->set_username(mp.creationLog.username); mp_item->mutable_creation_log()->set_host(mp.creationLog.host); mp_item->mutable_creation_log()->set_time(mp.creationLog.time); diff --git a/xroot_plugins/XrdCtaShowQueues.hpp b/xroot_plugins/XrdCtaShowQueues.hpp index bdd0eb0fb9ad54fafd60353454b1633b464b17f9..289e41b8d19a8d7d194e0d7dbb11e2a9e8685dde 100644 --- a/xroot_plugins/XrdCtaShowQueues.hpp +++ b/xroot_plugins/XrdCtaShowQueues.hpp @@ -81,12 +81,14 @@ int ShowQueuesStream::fillBuffer(XrdSsiPb::OStreamBuffer<Data> *streambuf) { case common::dataStructures::MountType::ArchiveForUser: sq_item->set_priority(sq.mountPolicy.archivePriority); sq_item->set_min_age(sq.mountPolicy.archiveMinRequestAge); - sq_item->set_max_drives(sq.mountPolicy.maxDrivesAllowed); + //TODO: max drives per VO + sq_item->set_max_drives(0); break; case common::dataStructures::MountType::Retrieve: sq_item->set_priority(sq.mountPolicy.retrievePriority); sq_item->set_min_age(sq.mountPolicy.retrieveMinRequestAge); - sq_item->set_max_drives(sq.mountPolicy.maxDrivesAllowed); + //TODO: max drives per VO + sq_item->set_max_drives(0); break; default: break; diff --git a/xroot_plugins/XrdSsiCtaRequestMessage.cpp b/xroot_plugins/XrdSsiCtaRequestMessage.cpp index 1b20d29320c0da87876011fb3d1df40abb0486c9..f56eb2d29877a7c7be87915ca7cb09e890657118 100644 --- a/xroot_plugins/XrdSsiCtaRequestMessage.cpp +++ b/xroot_plugins/XrdSsiCtaRequestMessage.cpp @@ -1390,7 +1390,6 @@ void RequestMessage::processMountPolicy_Add(cta::xrd::Response &response) auto &minarchiverequestage = getRequired(OptionUInt64::MIN_ARCHIVE_REQUEST_AGE); auto &retrievepriority = getRequired(OptionUInt64::RETRIEVE_PRIORITY); auto &minretrieverequestage = getRequired(OptionUInt64::MIN_RETRIEVE_REQUEST_AGE); - auto &maxdrivesallowed = getRequired(OptionUInt64::MAX_DRIVES_ALLOWED); auto &comment = getRequired(OptionString::COMMENT); cta::catalogue::CreateMountPolicyAttributes mountPolicy; @@ -1399,7 +1398,6 @@ void RequestMessage::processMountPolicy_Add(cta::xrd::Response &response) mountPolicy.minArchiveRequestAge = minarchiverequestage; mountPolicy.retrievePriority = retrievepriority; mountPolicy.minRetrieveRequestAge = minretrieverequestage; - mountPolicy.maxDrivesAllowed = maxdrivesallowed; mountPolicy.comment = comment; m_catalogue.createMountPolicy(m_cliIdentity, mountPolicy); @@ -1418,7 +1416,6 @@ void RequestMessage::processMountPolicy_Ch(cta::xrd::Response &response) auto minarchiverequestage = getOptional(OptionUInt64::MIN_ARCHIVE_REQUEST_AGE); auto retrievepriority = getOptional(OptionUInt64::RETRIEVE_PRIORITY); auto minretrieverequestage = getOptional(OptionUInt64::MIN_RETRIEVE_REQUEST_AGE); - auto maxdrivesallowed = getOptional(OptionUInt64::MAX_DRIVES_ALLOWED); auto comment = getOptional(OptionString::COMMENT); if(archivepriority) { @@ -1433,9 +1430,6 @@ void RequestMessage::processMountPolicy_Ch(cta::xrd::Response &response) if(minretrieverequestage) { m_catalogue.modifyMountPolicyRetrieveMinRequestAge(m_cliIdentity, group, minretrieverequestage.value()); } - if(maxdrivesallowed) { - m_catalogue.modifyMountPolicyMaxDrivesAllowed(m_cliIdentity, group, maxdrivesallowed.value()); - } if(comment) { m_catalogue.modifyMountPolicyComment(m_cliIdentity, group, comment.value()); }