Build: #909 was successful Manual run by daryl herzmann

Build result summary

Details

Completed
Queue duration
< 1 second
Duration
1 minute
Labels
None
Agent
Default Agent
Revision
0d1fd96318c6d68dfa20ba58430f5466d9822c16
Total tests
450
Successful since
#749 ()

Tests

Code commits

Author Commit Message Commit date
Guus der Kinderen Guus der Kinderen 0d1fd96318c6d68dfa20ba58430f5466d9822c16 OF-2159: Do not re-use origin-id when generating a stanza
This fixes a misunderstanding of the text in the XEP. Although origin-id must be retained, its value shouldn't be re-used, as the local entity can't trust the owner to have used a unique value.
Guus der Kinderen Guus der Kinderen 307b01570960e799281286000950e5dba3529d6c OF-2157: Sequence-manager should be cluster-aware
Openfire has a 'sequence manager' that basically allows you to have unique numbers. We use this instead of a database autoincrement-like mechanism (which is different on every database, and thus hard to use generically in Openfire).

As far as I know, the sequence manager works pretty well in a clustered setup, with one caveat: as the sequence manager obtains a 'block' of sequences to be used, different members might all obtain a block of their own. Although they'd still use distinct values from their blocks, there is no predicting the order in which the values are used. This results in the values added to the database to not be sequential.

This is a problem for things like message logs, which assumes that each message in a conversation is ordered by ID.

This commit ensures that sequence values are stored in a distributed cache, ensuring that all cluster members see the same values, and obtain 'next' sequences under lock.

A drawback here is that there's database interaction (to obtain a new block of sequence values) while there's a cluster-wide lock). That will be limited to the specific sequence though.

Arguably, not all code that uses sequence manager values require the values used to be actually sequential (having them unique might be good enough for some applications). There might be room for optimization here, although it feels safest for now to ensure that all applications do get sequential values, as suggested by the API of the implementation.

As all database interaction is performed under a sequence-specific lock, there should not be a need to 'retry' (in case another process already modified the value). I've removed the retry logic that existed since 2004.
Guus der Kinderen Guus der Kinderen 98722dcc2c75716836d2efefb02bff0d7dd062d4 Improve type-safety by applying generics
Non-fuctional change.
Guus der Kinderen Guus der Kinderen dbdf7c6888553d7c960c11c9a6a4644f82363425 OF-2157: Ensure proper order of logged messages in cluster
It is important to assign a message ID, which is used for ordering messages in a conversation, soon
after the message arrived, as opposed to just before the message gets written to the database. In the latter
scenario, the message ID values might no longer reflect the order of the messages in a conversation, as
database writes are batched up together for performance reasons. Using these batches won't affect the
database-insertion order (as compared to the order of messages in the conversation) on a single Openfire
server, but when running in a cluster, these batches do have a good chance to mess up the order of things.
Guus der Kinderen Guus der Kinderen c3786bddb1a6cf66ca8d77ded70dbcfb4bf0ad41 OF-2157: Remove unnecessairy transaction logic

Jira issues

IssueDescriptionStatus
Unknown Issue TypeOF-2157Could not obtain issue details from Jira
Unknown Issue TypeOF-2159Could not obtain issue details from Jira