The Java Transactions SDK prints the following in our application:
Only one Transactions object should be created per application, but have found 2 doing background cleanup of transactions. This will degrade app performance and should be fixed immediately.
We do create 2 Transactions objects per application (application meaning one JVM), however, each Transaction object is for a separate bucket, because the application itself is using two buckets at a time. One regular bucket and one ephemeral.
Here is how the Transaction objects are being created:
Transactions.create(
javaCluster,
TransactionConfigBuilder.create()
.logOnFailure(true, Event.Severity.TRACING)
.cleanupLostAttempts(true)
.cleanupClientAttempts(true)
.metadataCollection(javaTransactionsCollection)
.numATRs(couchbaseConfiguration.numATRs)
.durabilityLevel(couchbaseConfiguration.durabilityLevel)
.cleanupWindow(couchbaseConfiguration.cleanupWindow)
.expirationTime(couchbaseConfiguration.expirationTime)
.keyValueTimeout(couchbaseConfiguration.keyValueTimeout)
.build()
)
In the above code for each bucket, then a separate collection is provided:
.metadataCollection(javaTransactionsCollection)
It seems logical to have a separate Transaction metadata collection named transaction for each bucket the application uses. When that is the case, the following log seems to be unnecessary:
Only one Transactions object should be created per application, but have found 2 doing background cleanup of transactions. This will degrade app performance and should be fixed immediately.
Is it okay to have separate Transaction metadata collection for each bucket? Or should it be better to use one bucket’s metadata collection to record transactions?
Thanks,
Z