Thanks @graham.pople!
Iām aware of the workaround of inserts in a transaction. We are going to upgrade to Couchbase 6.6 right away.
To give you some more information on this: on our Bamboo CI, tests that include transactions with the above error, never finish and we see logs like:
07-Jul-2020 14:36:24 2020-07-07 14:36:24 WARN config:523 - [com.couchbase.config][CollectionMapRefreshFailedEvent][10s] Collection Map refresh failed: FAILED {"coreId":"0xef0e39dc00000001"}
07-Jul-2020 14:36:24 com.couchbase.client.core.error.UnambiguousTimeoutException: GetCollectionManifestRequest {"cancelled":true,"completed":true,"coreId":"0xef0e39dc00000001","idempotent":true,"lastChannelId":"EF0E39DC00000001/000000005E64119D","lastDispatchedFrom":"10.233.85.221:52076","lastDispatchedTo":"couchbase-default-development-couchbase-0.couchbase-default-development-couchbase.development.svc.sigma:11210","reason":"TIMEOUT","requestId":110,"requestType":"GetCollectionManifestRequest","retried":29,"retryReasons":["KV_ERROR_MAP_INDICATED"],"service":{"bucket":"default","collection":"_default","opaque":"0x75","scope":"_default","type":"kv"},"timeoutMs":10000,"timings":{"dispatchMicros":319}}
07-Jul-2020 14:36:24 at com.couchbase.client.core.msg.BaseRequest.cancel(BaseRequest.java:163)
07-Jul-2020 14:36:24 at com.couchbase.client.core.Timer.lambda$register$2(Timer.java:157)
07-Jul-2020 14:36:24 at com.couchbase.client.core.deps.io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:672)
07-Jul-2020 14:36:24 at com.couchbase.client.core.deps.io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:747)
07-Jul-2020 14:36:24 at com.couchbase.client.core.deps.io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:472)
07-Jul-2020 14:36:24 at com.couchbase.client.core.deps.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
07-Jul-2020 14:36:24 at java.lang.Thread.run(Thread.java:748)
07-Jul-2020 14:36:24 2020-07-07 14:36:24 INFO io:493 - [com.couchbase.io][UnknownResponseStatusReceivedEvent] Received an unknown response status: 0x89 {"bucket":"default","coreId":"0xef0e39dc00000001","local":"/10.233.85.221:52076","remote":"couchbase-default-development-couchbase-0.couchbase-default-development-couchbase.development.svc.sigma/10.233.89.96:11210"}
07-Jul-2020 14:36:24 2020-07-07 14:36:24 WARN config:523 - [com.couchbase.config][CollectionMapRefreshFailedEvent][10s] Collection Map refresh failed: FAILED {"coreId":"0xef0e39dc00000001"}
07-Jul-2020 14:36:24 com.couchbase.client.core.error.UnambiguousTimeoutException: GetCollectionManifestRequest {"cancelled":true,"completed":true,"coreId":"0xef0e39dc00000001","idempotent":true,"lastChannelId":"EF0E39DC00000001/000000005E64119D","lastDispatchedFrom":"10.233.85.221:52076","lastDispatchedTo":"couchbase-default-development-couchbase-0.couchbase-default-development-couchbase.development.svc.sigma:11210","reason":"TIMEOUT","requestId":123,"requestType":"GetCollectionManifestRequest","retried":29,"retryReasons":["KV_ERROR_MAP_INDICATED"],"service":{"bucket":"default","collection":"_default","opaque":"0x7f","scope":"_default","type":"kv"},"timeoutMs":10000,"timings":{"dispatchMicros":329}}
07-Jul-2020 14:36:24 at com.couchbase.client.core.msg.BaseRequest.cancel(BaseRequest.java:163)
07-Jul-2020 14:36:24 at com.couchbase.client.core.Timer.lambda$register$2(Timer.java:157)
07-Jul-2020 14:36:24 at com.couchbase.client.core.deps.io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:672)
07-Jul-2020 14:36:24 at com.couchbase.client.core.deps.io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:747)
07-Jul-2020 14:36:24 at com.couchbase.client.core.deps.io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:472)
07-Jul-2020 14:36:24 at com.couchbase.client.core.deps.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
07-Jul-2020 14:36:24 at java.lang.Thread.run(Thread.java:748)
07-Jul-2020 14:36:41 2020-07-07 14:36:41 WARN endpoint:513 - [com.couchbase.endpoint][UnexpectedEndpointDisconnectedEvent] The remote side disconnected the endpoint unexpectedly {"circuitBreaker":"DISABLED","coreId":"0xef0e39dc00000002","local":"10.233.85.221:34500","remote":"couchbase-default-development-couchbase-1.couchbase-default-development-couchbase.development.svc.sigma:8093","type":"QUERY"}
07-Jul-2020 14:36:41 2020-07-07 14:36:41 WARN endpoint:513 - [com.couchbase.endpoint][UnexpectedEndpointDisconnectedEvent] The remote side disconnected the endpoint unexpectedly {"circuitBreaker":"DISABLED","coreId":"0xef0e39dc00000002","local":"10.233.85.221:42068","remote":"couchbase-default-development-couchbase-0.couchbase-default-development-couchbase.development.svc.sigma:8093","type":"QUERY"}
07-Jul-2020 14:36:45 2020-07-07 14:36:45 WARN endpoint:513 - [com.couchbase.endpoint][UnexpectedEndpointDisconnectedEvent] The remote side disconnected the endpoint unexpectedly {"circuitBreaker":"DISABLED","coreId":"0xef0e39dc00000001","local":"10.233.85.221:42128","remote":"couchbase-default-development-couchbase-0.couchbase-default-development-couchbase.development.svc.sigma:8093","type":"QUERY"}
07-Jul-2020 14:36:45 2020-07-07 14:36:45 WARN endpoint:513 - [com.couchbase.endpoint][UnexpectedEndpointDisconnectedEvent] The remote side disconnected the endpoint unexpectedly {"circuitBreaker":"DISABLED","coreId":"0xef0e39dc00000001","local":"10.233.85.221:34502","remote":"couchbase-default-development-couchbase-1.couchbase-default-development-couchbase.development.svc.sigma:8093","type":"QUERY"}
07-Jul-2020 14:37:11 2020-07-07 14:37:11 INFO stats:493 - [com.couchbase.transactions.cleanup.stats][TransactionCleanupEndRunEvent] start={default/_default/clientId=d4df1,index=0,numClients=1,ATRs={checking=1024,total=1024},runLength=60000millis},end={taken=59781millis,ATRs={read=1024,errored=0,present=149},entries={expired=0,failed=0,total=1},maxEntries=1}
07-Jul-2020 14:38:11 2020-07-07 14:38:11 INFO stats:493 - [com.couchbase.transactions.cleanup.stats][TransactionCleanupEndRunEvent] start={default/_default/clientId=d4df1,index=0,numClients=1,ATRs={checking=1024,total=1024},runLength=60000millis},end={taken=59648millis,ATRs={read=1024,errored=0,present=149},entries={expired=0,failed=0,total=0},maxEntries=0}
07-Jul-2020 14:39:10 2020-07-07 14:39:10 INFO stats:493 - [com.couchbase.transactions.cleanup.stats][TransactionCleanupEndRunEvent] start={default/_default/clientId=d4df1,index=0,numClients=1,ATRs={checking=1024,total=1024},runLength=60000millis},end={taken=59628millis,ATRs={read=1024,errored=0,present=149},entries={expired=0,failed=0,total=0},maxEntries=0}
07-Jul-2020 14:40:10 2020-07-07 14:40:10 INFO stats:493 - [com.couchbase.transactions.cleanup.stats][TransactionCleanupEndRunEvent] start={default/_default/clientId=d4df1,index=0,numClients=1,ATRs={checking=1024,total=1024},runLength=60000millis},end={taken=59616millis,ATRs={read=1024,errored=0,present=149},entries={expired=0,failed=0,total=0},maxEntries=0}
07-Jul-2020 14:41:10 2020-07-07 14:41:10 INFO stats:493 - [com.couchbase.transactions.cleanup.stats][TransactionCleanupEndRunEvent] start={default/_default/clientId=d4df1,index=0,numClients=1,ATRs={checking=1024,total=1024},runLength=60000millis},end={taken=59603millis,ATRs={read=1024,errored=0,present=149},entries={expired=0,failed=0,total=0},maxEntries=0}
07-Jul-2020 14:42:09 2020-07-07 14:42:09 INFO stats:493 - [com.couchbase.transactions.cleanup.stats][TransactionCleanupEndRunEvent] start={default/_default/clientId=d4df1,index=0,numClients=1,ATRs={checking=1024,total=1024},runLength=60000millis},end={taken=59573millis,ATRs={read=1024,errored=0,present=149},entries={expired=0,failed=0,total=0},maxEntries=0}
07-Jul-2020 14:43:09 2020-07-07 14:43:09 INFO stats:493 - [com.couchbase.transactions.cleanup.stats][TransactionCleanupEndRunEvent] start={default/_default/clientId=d4df1,index=0,numClients=1,ATRs={checking=1024,total=1024},runLength=60000millis},end={taken=59558millis,ATRs={read=1024,errored=0,present=149},entries={expired=0,failed=0,total=0},maxEntries=0}
One additional thing: it would be nice to be able to ask the API to directly throw out a certain type of exceptions when a transaction fails. We use a similar idom currently:
[...]
try {
transactions.run((t: AttemptContext) => {
transactionID = Some(t.transactionId())
result = Some(f(t))
})
} catch {
case f: TransactionFailed =>
if (t(f.getCause)) {
throw f.getCause // we need the cause
} else {
throw f
}
} finally {
transactionID.foreach {
cleanupTransaction
}
}
[...]
Getting a TransactionFailed
useful when there is something went wrong with the transaction itself, but when business objects and other services throw an exception, that is useful if thrown directly. This is just a questions of convenience.
Thanks,
ZoltƔn