Remove database call from ModifySubscriptionTask
The cluster task that modifies a subscription to a pubsub node is provided in org.jivesoftware.openfire.pubsub.cluster.ModifySubscriptionTask
Ideally, cluster tasks are very lightweight, as they can be executed on many cluster nodes. The 'heavy lifting' is expected to be done on the cluster node where the task originates (eg: database modifications are done only there). The cluster task executed on other nodes should only need to modify any state that's kept in-memory.
The implementation of this particular modification task is based on re-loading data from the database, which will overwrite the data that is in-memory, and possibly stale. Functionally, I see no issue. However, from a performance point of view, it's undesirable to have a database interaction, as this is potentially executed on all cluster nodes (which would hammer the database). The implementation should be improved to only work on in-memory data, updating that with the data provided by the task.