From 1949b2be9b4942ca5b3696df64683299a5a9073a Mon Sep 17 00:00:00 2001 From: Evgeny Malygin Date: Tue, 26 Nov 2024 18:46:32 +0000 Subject: [PATCH] Remove cancelReplicationNotification Signed-off-by: Evgeny Malygin --- src/groups/mqb/mqbblp/mqbblp_localqueue.cpp | 10 ---------- src/groups/mqb/mqbblp/mqbblp_storagemanager.cpp | 15 --------------- src/groups/mqb/mqbblp/mqbblp_storagemanager.h | 7 ------- src/groups/mqb/mqbc/mqbc_storagemanager.cpp | 15 --------------- src/groups/mqb/mqbc/mqbc_storagemanager.h | 7 ------- src/groups/mqb/mqbi/mqbi_storagemanager.h | 7 ------- src/groups/mqb/mqbmock/mqbmock_storagemanager.cpp | 7 ------- src/groups/mqb/mqbmock/mqbmock_storagemanager.h | 7 ------- src/groups/mqb/mqbs/mqbs_filestore.cpp | 9 --------- src/groups/mqb/mqbs/mqbs_filestore.h | 6 ------ 10 files changed, 90 deletions(-) diff --git a/src/groups/mqb/mqbblp/mqbblp_localqueue.cpp b/src/groups/mqb/mqbblp/mqbblp_localqueue.cpp index de10707b0..98decdcf4 100644 --- a/src/groups/mqb/mqbblp/mqbblp_localqueue.cpp +++ b/src/groups/mqb/mqbblp/mqbblp_localqueue.cpp @@ -186,16 +186,6 @@ int LocalQueue::configure(bsl::ostream& errorDescription, bool isReconfigure) domainCfg.storage().queueLimits().bytes()); if (isReconfigure) { - if (domainCfg.consistency().isStrongValue()) { - /// We register notifications for weak consistency queues to - /// deliver messages after any replication. For strong consistency - /// queues, we start to PUSH only on receipt. We have to check and - /// possibly remove from notifications the queues that changed - /// their consistency level from weak to strong. - d_state_p->storageManager()->cancelReplicationNotification( - d_state_p->partitionId(), - d_state_p->key()); - } if (domainCfg.mode().isFanoutValue()) { d_state_p->stats().updateDomainAppIds( domainCfg.mode().fanout().appIDs()); diff --git a/src/groups/mqb/mqbblp/mqbblp_storagemanager.cpp b/src/groups/mqb/mqbblp/mqbblp_storagemanager.cpp index 73e83cdd4..dcd41f5e1 100644 --- a/src/groups/mqb/mqbblp/mqbblp_storagemanager.cpp +++ b/src/groups/mqb/mqbblp/mqbblp_storagemanager.cpp @@ -2130,21 +2130,6 @@ void StorageManager::gcUnrecognizedDomainQueues() d_unrecognizedDomains); } -void StorageManager::cancelReplicationNotification( - int partitionId, - const mqbu::StorageKey& queueKey) -{ - // executed by *QUEUE* dispatcher thread associated with partitionId - - // PRECONDITIONS - BSLS_ASSERT_SAFE(0 <= partitionId && - partitionId < static_cast(d_fileStores.size())); - - mqbs::FileStore* fs = d_fileStores[partitionId].get(); - BSLS_ASSERT_SAFE(fs->inDispatcherThread()); - fs->cancelReplicationNotification(queueKey); -} - // ACCESSORS bool StorageManager::isStorageEmpty(const bmqt::Uri& uri, int partitionId) const diff --git a/src/groups/mqb/mqbblp/mqbblp_storagemanager.h b/src/groups/mqb/mqbblp/mqbblp_storagemanager.h index acede6028..6ff9ba213 100644 --- a/src/groups/mqb/mqbblp/mqbblp_storagemanager.h +++ b/src/groups/mqb/mqbblp/mqbblp_storagemanager.h @@ -706,13 +706,6 @@ class StorageManager : public mqbi::StorageManager { /// GC the queues from unrecognized domains, if any. virtual void gcUnrecognizedDomainQueues() BSLS_KEYWORD_OVERRIDE; - /// Cancel replication notification (if any) for the specified `queueKey`. - /// Thread: executed by QUEUE dispatcher thread associated with the - /// specified `partitionId`. - void cancelReplicationNotification(int partitionId, - const mqbu::StorageKey& queueKey) - BSLS_KEYWORD_OVERRIDE; - // ACCESSORS /// Return the processor handle in charge of the specified diff --git a/src/groups/mqb/mqbc/mqbc_storagemanager.cpp b/src/groups/mqb/mqbc/mqbc_storagemanager.cpp index def0e4a6f..fcd681715 100644 --- a/src/groups/mqb/mqbc/mqbc_storagemanager.cpp +++ b/src/groups/mqb/mqbc/mqbc_storagemanager.cpp @@ -4474,21 +4474,6 @@ void StorageManager::gcUnrecognizedDomainQueues() d_unrecognizedDomains); } -void StorageManager::cancelReplicationNotification( - int partitionId, - const mqbu::StorageKey& queueKey) -{ - // executed by *QUEUE* dispatcher thread associated with partitionId - - // PRECONDITIONS - BSLS_ASSERT_SAFE(0 <= partitionId && - partitionId < static_cast(d_fileStores.size())); - - mqbs::FileStore* fs = d_fileStores[partitionId].get(); - BSLS_ASSERT_SAFE(fs->inDispatcherThread()); - fs->cancelReplicationNotification(queueKey); -} - mqbs::FileStore& StorageManager::fileStore(int partitionId) { // PRECONDITIONS diff --git a/src/groups/mqb/mqbc/mqbc_storagemanager.h b/src/groups/mqb/mqbc/mqbc_storagemanager.h index 99f05ab96..5ba16299b 100644 --- a/src/groups/mqb/mqbc/mqbc_storagemanager.h +++ b/src/groups/mqb/mqbc/mqbc_storagemanager.h @@ -1046,13 +1046,6 @@ class StorageManager /// GC the queues from unrecognized domains, if any. virtual void gcUnrecognizedDomainQueues() BSLS_KEYWORD_OVERRIDE; - /// Cancel replication notification (if any) for the specified `queueKey`. - /// Thread: executed by QUEUE dispatcher thread associated with the - /// specified `partitionId`. - void cancelReplicationNotification(int partitionId, - const mqbu::StorageKey& queueKey) - BSLS_KEYWORD_OVERRIDE; - /// Return partition corresponding to the specified `partitionId`. The /// behavior is undefined if `partitionId` does not represent a valid /// partition id. Note, this modifiable reference to partition is only diff --git a/src/groups/mqb/mqbi/mqbi_storagemanager.h b/src/groups/mqb/mqbi/mqbi_storagemanager.h index 4993fbbf3..4d5ee2bec 100644 --- a/src/groups/mqb/mqbi/mqbi_storagemanager.h +++ b/src/groups/mqb/mqbi/mqbi_storagemanager.h @@ -413,13 +413,6 @@ class StorageManager { /// GC the queues from unrecognized domains, if any. virtual void gcUnrecognizedDomainQueues() = 0; - /// Cancel replication notification (if any) for the specified `queueKey`. - /// Thread: executed by QUEUE dispatcher thread associated with the - /// specified `partitionId`. - virtual void - cancelReplicationNotification(int partitionId, - const mqbu::StorageKey& queueKey) = 0; - // ACCESSORS /// Return the processor handle in charge of the specified diff --git a/src/groups/mqb/mqbmock/mqbmock_storagemanager.cpp b/src/groups/mqb/mqbmock/mqbmock_storagemanager.cpp index 0fce75e13..236cf17b3 100644 --- a/src/groups/mqb/mqbmock/mqbmock_storagemanager.cpp +++ b/src/groups/mqb/mqbmock/mqbmock_storagemanager.cpp @@ -276,13 +276,6 @@ void StorageManager::gcUnrecognizedDomainQueues() // NOTHING } -void StorageManager::cancelReplicationNotification( - BSLS_ANNOTATION_UNUSED int partitionId, - BSLS_ANNOTATION_UNUSED const mqbu::StorageKey& queueKey) -{ - // NOTHING -} - // ACCESSORS mqbi::Dispatcher::ProcessorHandle StorageManager::processorForPartition( BSLS_ANNOTATION_UNUSED int partitionId) const diff --git a/src/groups/mqb/mqbmock/mqbmock_storagemanager.h b/src/groups/mqb/mqbmock/mqbmock_storagemanager.h index 0530e0f28..bde6f1924 100644 --- a/src/groups/mqb/mqbmock/mqbmock_storagemanager.h +++ b/src/groups/mqb/mqbmock/mqbmock_storagemanager.h @@ -270,13 +270,6 @@ class StorageManager : public mqbi::StorageManager { /// GC the queues from unrecognized domains, if any. virtual void gcUnrecognizedDomainQueues() BSLS_KEYWORD_OVERRIDE; - /// Cancel replication notification (if any) for the specified `queueKey`. - /// Thread: executed by QUEUE dispatcher thread associated with the - /// specified `partitionId`. - void cancelReplicationNotification(int partitionId, - const mqbu::StorageKey& queueKey) - BSLS_KEYWORD_OVERRIDE; - // ACCESSORS /// Return the processor handle in charge of the specified diff --git a/src/groups/mqb/mqbs/mqbs_filestore.cpp b/src/groups/mqb/mqbs/mqbs_filestore.cpp index c7d6b8b8c..b1c719514 100644 --- a/src/groups/mqb/mqbs/mqbs_filestore.cpp +++ b/src/groups/mqb/mqbs/mqbs_filestore.cpp @@ -6948,15 +6948,6 @@ void FileStore::flushQueues() } } -void FileStore::cancelReplicationNotification(const mqbu::StorageKey& queueKey) -{ - bsl::unordered_set::iterator it = - d_replicationNotifications.find(queueKey); - if (it != d_replicationNotifications.end()) { - d_replicationNotifications.erase(it); - } -} - bool FileStore::gcExpiredMessages(const bdlt::Datetime& currentTimeUtc) { if (!d_isOpen) { diff --git a/src/groups/mqb/mqbs/mqbs_filestore.h b/src/groups/mqb/mqbs/mqbs_filestore.h index 0fb5ffbab..aacb67d55 100644 --- a/src/groups/mqb/mqbs/mqbs_filestore.h +++ b/src/groups/mqb/mqbs/mqbs_filestore.h @@ -884,12 +884,6 @@ class FileStore : public DataStore { /// builder is empty (just flushed). void notifyQueuesOnReplicatedBatch(); - /// When reconfigure from weak consistency to strong consistency: - /// Cancel replication notification (if any) for the specified `queueKey`. - /// No effect if `queueKey` is not found in this storage or if there are no - /// current registered notifications for this queue. - void cancelReplicationNotification(const mqbu::StorageKey& queueKey); - /// Invoke the specified `functor` with each queue associated to the /// partition represented by this FileStore if the partition was /// successfully opened. The behavior is undefined unless invoked from