I have been experiencing a delay in openfire startup, its taking close to 10 -15 mins to come up. On troubleshooting, Its observed that Openfire is taking long time to load pubsub nodes.
2022.04.05 15:52:22 INFO [main]: org.jivesoftware.util.cache.CacheFactory - Created cache [org.jivesoftware.util.cache.DefaultLocalCacheStrategy] for File Transfer
2022.04.05 15:52:22 WARN [main]: org.jivesoftware.util.LocaleUtils - Missing resource for key: system_property.provider.pubsub-persistence.className in locale en
2022.04.05 15:52:22 DEBUG [main]: org.jivesoftware.openfire.pubsub.PubSubPersistenceProviderManager - Clustering is enabled. Falling back to non-cached provider
2022.04.05 15:52:22 INFO [main]: org.jivesoftware.openfire.pubsub.PubSubPersistenceProviderManager - Loading PubSub persistence provider: class org.jivesoftware.openfire.pubsub.DefaultPubSubPersistenceProvider.
2022.04.05 15:52:22 INFO [main]: org.jivesoftware.util.cache.CacheFactory - Created cache [org.jivesoftware.util.cache.DefaultLocalCacheStrategy] for Default Node Configurations
2022.04.05 15:52:22 DEBUG [main]: org.jivesoftware.openfire.pubsub.DefaultPubSubPersistenceProvider - Initializing
2022.04.05 15:52:22 DEBUG [main]: org.jivesoftware.openfire.pubsub.PubSubModule - Initializing using service name: ‘pubsub’
2022.04.05 15:52:22 DEBUG [main]: org.jivesoftware.openfire.pubsub.DefaultPubSubPersistenceProvider - Loading nodes for service: pubsub
2022.04.05 16:00:45 DEBUG [main]: org.jivesoftware.openfire.pubsub.PubSubModule - Load root collection node (’’) from database.
2022.04.05 16:00:45 INFO [main]: org.jivesoftware.util.cache.CacheFactory - Created cache [org.jivesoftware.util.cache.DefaultLocalCacheStrategy] for Disco Server Features
Further found that my Openfire(4.6.0) instance has 63,000 nodes. I tested with 4000 nodes and that started without delay. As I understand, the delay occurred as Openfire has more number of nodes to be loaded. Tested 63,000 nodes with Openfire 4.5.4 and that coming up fast.
Have taken a look at the code and I see that in 4.6.0, the loading nodes and node affiliations are changed. From my debug, I could see the potential cause of the issue is in the ‘lookupNode’ function of Class DefaultPubSubPersistenceProvider.