In force replication, some time has reversion number error
Using Morpho to update a documents in a local metacat, the remote metacat
sometime has error:
ERROR in MetacatReplication.handleForceReplicateRequest():
Error in DBSaxHandler.startElement UPDATE
java.lang.Exception: Next revision number couldn't be less than or equal 8 (
or other number).
This error sometimes happened, sometimes not. I didn't find the pattern.
#1 Updated by Jing Tao about 20 years ago
In class ForceReplicationHandler, we use a for loop the check every server in
replication tables to see if we need to send a url force replication request.
But in the start of for loop, we didn't reset the url to null. So if the next
iteration didn't overwrite the previous one, the previouse one will send twice.
So the remote server will request a same document twise and cause the error.
Now the url will be reset again and the error between two replication of
metacat is gone.
But if there are 3 metacats - A, B, C and they can replicate to each other. If
A inert a document and it will replicate to B and C. B write the documents
into its database and send a force replication request to C. C will ask the
same doc form B. But when C got the doc info from and found it already have it.
So the exception will happend.
Same thing will happend to B too.
If we don't want the feature that force replication will happend during a
replication(if we do that, we will get rid of the exception). The hub will not
automatically replicate the documents which it got from other host to the
It is only exception and no hurt to metacat. So we can keep it.