Server Couchbase 7.0 Beta
Test code below:
val lockingWhatnot = ensureUpserted[Barcode, Whatnot](Whatnot.dummy)
// code will block until above item was retrieved back from Couchbase
// lockingWhatnot is really in the database
(1 to 20).par.foreach {
_ =>
Whatnots.inTransaction {
implicit $ =>
Whatnots.inTransaction.insert(Whatnot.dummy)
Whatnots.inTransaction.replace {
Whatnots.inTransaction.need(lockingWhatnot.ID)
}
Whatnots.inTransaction.insert(Whatnot.dummy)
}()
}
}
Where inTransactions
:
def inTransaction[R](f: AttemptContext => R)(t: Throwable => Boolean = _ => true): R = {
var result: Option[R] = None
var transactionID: Option[String] = None
try {
transactions.run {
(t: AttemptContext) =>
transactionID = Some(t.transactionId())
result = Some(f(t))
}
} catch {
case f: TransactionFailed =>
f.result().log().logs().toArray.foreach(System.err.println(_))
if (Option(f.getCause).isDefined && t(f.getCause)) {
throw f.getCause
} else {
throw f
}
case f: Throwable =>
throw f
} finally {
transactionID.foreach(cleanupTransaction)
}
result.get
}
Produces the below logs:
23:09:11.080 57/scala-execution-context-global-57/f4b7a config: atrs=20480, expiry=30000msecs durability=MAJORITY per-txn config= durability=Optional.empty, supported=Supported {extensions=[EXT_TRANSACTION_ID, EXT_DEFERRED_COMMIT, EXT_TIME_OPT_UNSTAGING, EXT_BINARY_METADATA, EXT_CUSTOM_METADATA, EXT_QUERY], protocol=2.0}
23:09:11.081 57/scala-execution-context-global-57/f4b7a/e6516 First mutated doc in txn is 'default.default.cihcs-Whatnot_c.hub.constraint:𪜂𣻕ᘲ漳简𩞿뵣𥵞⼟𫼗𤜣𨀄屄ę𦝇𬙌옺𒃠ཟ𦓚ﭭ' on vbucket 156, so using atr _txn:atr-156-#36e8
23:09:11.081 57/scala-execution-context-global-57/f4b7a/e6516 expiration time remaining is 30000 millis (capped from 30000)
23:09:11.081 57/scala-execution-context-global-57/f4b7a/e6516 about to set ATR default:default.transactions._txn:atr-156-#36e8 to Pending
23:09:11.119 57/scala-execution-context-global-57/f4b7a/e6516 set ATR default:default.transactions._txn:atr-156-#36e8 to Pending in 38ms, got CAS (start time) cas=1606774150946357248,seqno=315,vbucket=156
23:09:11.119 57/scala-execution-context-global-57/f4b7a/e6516 about to insert staged doc default.default.cihcs-Whatnot_c.hub.constraint:𪜂𣻕ᘲ漳简𩞿뵣𥵞⼟𫼗𤜣𨀄屄ę𦝇𬙌옺𒃠ཟ𦓚ﭭ as shadow document, cas=Optional.empty
23:09:11.151 57/scala-execution-context-global-57/f4b7a/e6516 inserted doc default.default.cihcs-Whatnot_c.hub.constraint:𪜂𣻕ᘲ漳简𩞿뵣𥵞⼟𫼗𤜣𨀄屄ę𦝇𬙌옺𒃠ཟ𦓚ﭭ got cas=1606774150978994176,seqno=317,vbucket=156, in 31ms
23:09:11.152 57/scala-execution-context-global-57/f4b7a/e6516 about to insert staged doc default.default.cihcs-Whatnot_e.fvp3tpTSfG5wwZlfhbGyRgKoJF2pf37V as shadow document, cas=Optional.empty
23:09:11.200 57/scala-execution-context-global-57/f4b7a/e6516 inserted doc default.default.cihcs-Whatnot_e.fvp3tpTSfG5wwZlfhbGyRgKoJF2pf37V got cas=1606774151020019712,seqno=321,vbucket=428, in 48ms
23:09:11.200 57/scala-execution-context-global-57/f4b7a/e6516 getting doc default.default.cihcs-Whatnot_e.2OxjCDuTU4M9uUsCGsnOmzacYOm47ABg, resolvingMissingATREntry=<empty>
23:09:11.232 57/scala-execution-context-global-57/f4b7a/e6516 doc default.default.cihcs-Whatnot_e.2OxjCDuTU4M9uUsCGsnOmzacYOm47ABg is in a transaction, looking up its status from ATR (MAV read)
23:09:11.263 57/scala-execution-context-global-57/f4b7a/e6516 got error while getting doc default.default.cihcs-Whatnot_e.2OxjCDuTU4M9uUsCGsnOmzacYOm47ABg: {err=ActiveTransactionRecordNotFound,ec=FAIL_OTHER,msg='43d01a06-cada-423f-942a-cbb5be7cc491'}
23:09:11.263 57/scala-execution-context-global-57/f4b7a/e6516 caught exception 'TransactionOperationFailed {ec:FAIL_OTHER, cause:com.couchbase.transactions.error.attempts.ActiveTransactionRecordNotFound, retry:false, autoRollback:true, raise:TRANSACTION_FAILED}' in runBlocking, rethrowing
23:09:11.263 57/scala-execution-context-global-57/f4b7a/e6516 com.couchbase.transactions.error.internal.TransactionOperationFailedBuilder.build(TransactionOperationFailedBuilder.java:59)
23:09:11.263 57/scala-execution-context-global-57/f4b7a/e6516 com.couchbase.transactions.AttemptContextReactive.lambda$null$14(AttemptContextReactive.java:606)
23:09:11.263 57/scala-execution-context-global-57/f4b7a/<> finishing attempt off after error 'TransactionOperationFailed {ec:FAIL_OTHER, cause:com.couchbase.transactions.error.attempts.ActiveTransactionRecordNotFound, retry:false, autoRollback:true, raise:TRANSACTION_FAILED}'
23:09:11.263 57/scala-execution-context-global-57/f4b7a/e6516 auto-rolling-back on error
23:09:11.263 57/scala-execution-context-global-57/f4b7a/e6516 rollback AttemptContextReactive{id=e6516,state=ROLLED_BACK,atr=default:default.transactions._txn:atr-156-#36e8,staged=[INSERT default.default.cihcs-Whatnot_c.hub.constraint:𪜂𣻕ᘲ漳简𩞿뵣𥵞⼟𫼗𤜣𨀄屄ę𦝇𬙌옺𒃠ཟ𦓚ﭭ, INSERT default.default.cihcs-Whatnot_e.fvp3tpTSfG5wwZlfhbGyRgKoJF2pf37V]} expiryOvertimeMode=false isAppRollback=false
23:09:11.096 60/scala-execution-context-global-60/67044 starting attempt 0/6704485b-ab33-41d4-9f28-e066de1e028b/ccc7b28a-f5fd-4b48-906e-da84401d05e9
23:09:11.096 60/scala-execution-context-global-60/67044 config: atrs=20480, expiry=30000msecs durability=MAJORITY per-txn config= durability=Optional.empty, supported=Supported {extensions=[EXT_TRANSACTION_ID, EXT_DEFERRED_COMMIT, EXT_TIME_OPT_UNSTAGING, EXT_BINARY_METADATA, EXT_CUSTOM_METADATA, EXT_QUERY], protocol=2.0}
23:09:11.263 57/scala-execution-context-global-57/f4b7a/e6516 aborting ATR default:default.transactions._txn:atr-156-#36e8 isAppRollback=false ambiguityResolutionMode=false
23:09:11.097 60/scala-execution-context-global-60/67044/ccc7b First mutated doc in txn is 'default.default.cihcs-Whatnot_c.hub.constraint:𐬇𝔓蠥𑒛뼌𨏐𓂙𤸿谧𗇲顯𦬗𘉲𡬧䤮𢇥𫽑𥥣콴' on vbucket 414, so using atr _txn:atr-414-#aeeb
23:09:11.298 57/scala-execution-context-global-57/f4b7a/e6516 aborted ATR default:default.transactions._txn:atr-156-#36e8
23:09:11.097 60/scala-execution-context-global-60/67044/ccc7b expiration time remaining is 29999 millis (capped from 29999)
23:09:11.298 57/scala-execution-context-global-57/f4b7a/e6516 deleting inserted doc default.default.cihcs-Whatnot_c.hub.constraint:𪜂𣻕ᘲ漳简𩞿뵣𥵞⼟𫼗𤜣𨀄屄ę𦝇𬙌옺𒃠ཟ𦓚ﭭ with cas 1606774150978994176
23:09:11.097 60/scala-execution-context-global-60/67044/ccc7b about to set ATR default:default.transactions._txn:atr-414-#aeeb to Pending
23:09:11.123 60/scala-execution-context-global-60/67044/ccc7b set ATR default:default.transactions._txn:atr-414-#aeeb to Pending in 25ms, got CAS (start time) cas=1606774150947733504,seqno=340,vbucket=414
23:09:11.321 57/scala-execution-context-global-57/f4b7a/e6516 deleted inserted doc default.default.cihcs-Whatnot_c.hub.constraint:𪜂𣻕ᘲ漳简𩞿뵣𥵞⼟𫼗𤜣𨀄屄ę𦝇𬙌옺𒃠ཟ𦓚ﭭ, mt Optional[mt{vbID=156, vbUUID=247073107826988, seqno=321, bucket=default}]
23:09:11.123 60/scala-execution-context-global-60/67044/ccc7b about to insert staged doc default.default.cihcs-Whatnot_c.hub.constraint:𐬇𝔓蠥𑒛뼌𨏐𓂙𤸿谧𗇲顯𦬗𘉲𡬧䤮𢇥𫽑𥥣콴 as shadow document, cas=Optional.empty
23:09:11.321 57/scala-execution-context-global-57/f4b7a/e6516 deleting inserted doc default.default.cihcs-Whatnot_e.fvp3tpTSfG5wwZlfhbGyRgKoJF2pf37V with cas 1606774151020019712
23:09:11.154 60/scala-execution-context-global-60/67044/ccc7b inserted doc default.default.cihcs-Whatnot_c.hub.constraint:𐬇𝔓蠥𑒛뼌𨏐𓂙𤸿谧𗇲顯𦬗𘉲𡬧䤮𢇥𫽑𥥣콴 got cas=1606774150980435968,seqno=342,vbucket=414, in 30ms
23:09:11.362 57/scala-execution-context-global-57/f4b7a/e6516 deleted inserted doc default.default.cihcs-Whatnot_e.fvp3tpTSfG5wwZlfhbGyRgKoJF2pf37V, mt Optional[mt{vbID=428, vbUUID=56783730644498, seqno=323, bucket=default}]
23:09:11.155 60/scala-execution-context-global-60/67044/ccc7b about to insert staged doc default.default.cihcs-Whatnot_e.NeR2huD3LRxweN3mFuI9cEhhVOzApW5w as shadow document, cas=Optional.empty
23:09:11.363 57/scala-execution-context-global-57/f4b7a/e6516 marking ATR default:default.transactions._txn:atr-156-#36e8 as rollback complete
23:09:11.400 57/scala-execution-context-global-57/f4b7a/e6516 rollback - atr rolled back
23:09:11.202 60/scala-execution-context-global-60/67044/ccc7b inserted doc default.default.cihcs-Whatnot_e.NeR2huD3LRxweN3mFuI9cEhhVOzApW5w got cas=1606774151020937216,seqno=384,vbucket=947, in 47ms
23:09:11.400 57/scala-execution-context-global-57/f4b7a/e6516 Adding cleanup request for transactions/_txn:atr-156-#36e8 to run in 30000 msecs
23:09:11.202 60/scala-execution-context-global-60/67044/ccc7b getting doc default.default.cihcs-Whatnot_e.2OxjCDuTU4M9uUsCGsnOmzacYOm47ABg, resolvingMissingATREntry=<empty>
23:09:11.400 57/scala-execution-context-global-57/f4b7a/e6516 added attempt TransactionAttempt{id=e6516,state=ROLLED_BACK,atr=default:default.transactions._txn:atr-156-#36e8} after error
23:09:11.238 60/scala-execution-context-global-60/67044/ccc7b doc default.default.cihcs-Whatnot_e.2OxjCDuTU4M9uUsCGsnOmzacYOm47ABg is in a transaction, looking up its status from ATR (MAV read)
23:09:11.400 57/scala-execution-context-global-57/f4b7a/<> reraising original exception 'TransactionOperationFailed' com.couchbase.transactions.error.attempts.ActiveTransactionRecordNotFound: 43d01a06-cada-423f-942a-cbb5be7cc491
23:09:11.400 57/scala-execution-context-global-57/f4b7a TransactionOperationFailed retryTransaction=false
23:09:11.265 60/scala-execution-context-global-60/67044/ccc7b got error while getting doc default.default.cihcs-Whatnot_e.2OxjCDuTU4M9uUsCGsnOmzacYOm47ABg: {err=ActiveTransactionRecordNotFound,ec=FAIL_OTHER,msg='43d01a06-cada-423f-942a-cbb5be7cc491'}
23:09:11.400 57/scala-execution-context-global-57/f4b7a/e6516 converted TransactionOperationFailed TRANSACTION_FAILED to final error com.couchbase.transactions.error.TransactionFailed: Transaction has failed with cause 'com.couchbase.transactions.error.attempts.ActiveTransactionRecordNotFound: 43d01a06-cada-423f-942a-cbb5be7cc491'
23:09:11.265 60/scala-execution-context-global-60/67044/ccc7b caught exception 'TransactionOperationFailed {ec:FAIL_OTHER, cause:com.couchbase.transactions.error.attempts.ActiveTransactionRecordNotFound, retry:false, autoRollback:true, raise:TRANSACTION_FAILED}' in runBlocking, rethrowing
23:09:11.265 60/scala-execution-context-global-60/67044/ccc7b com.couchbase.transactions.error.internal.TransactionOperationFailedBuilder.build(TransactionOperationFailedBuilder.java:59)
23:09:11.265 60/scala-execution-context-global-60/67044/ccc7b com.couchbase.transactions.AttemptContextReactive.lambda$null$14(AttemptContextReactive.java:606)
23:09:11.265 60/scala-execution-context-global-60/67044/<> finishing attempt off after error 'TransactionOperationFailed {ec:FAIL_OTHER, cause:com.couchbase.transactions.error.attempts.ActiveTransactionRecordNotFound, retry:false, autoRollback:true, raise:TRANSACTION_FAILED}'
23:09:11.265 60/scala-execution-context-global-60/67044/ccc7b auto-rolling-back on error
23:09:11.265 60/scala-execution-context-global-60/67044/ccc7b rollback AttemptContextReactive{id=ccc7b,state=ROLLED_BACK,atr=default:default.transactions._txn:atr-414-#aeeb,staged=[INSERT default.default.cihcs-Whatnot_c.hub.constraint:𐬇𝔓蠥𑒛뼌𨏐𓂙𤸿谧𗇲顯𦬗𘉲𡬧䤮𢇥𫽑𥥣콴, INSERT default.default.cihcs-Whatnot_e.NeR2huD3LRxweN3mFuI9cEhhVOzApW5w]} expiryOvertimeMode=false isAppRollback=false
23:09:11.265 60/scala-execution-context-global-60/67044/ccc7b aborting ATR default:default.transactions._txn:atr-414-#aeeb isAppRollback=false ambiguityResolutionMode=false
23:09:11.301 60/scala-execution-context-global-60/67044/ccc7b aborted ATR default:default.transactions._txn:atr-414-#aeeb
23:09:11.301 60/scala-execution-context-global-60/67044/ccc7b deleting inserted doc default.default.cihcs-Whatnot_c.hub.constraint:𐬇𝔓蠥𑒛뼌𨏐𓂙𤸿谧𗇲顯𦬗𘉲𡬧䤮𢇥𫽑𥥣콴 with cas 1606774150980435968
23:09:11.339 60/scala-execution-context-global-60/67044/ccc7b deleted inserted doc default.default.cihcs-Whatnot_c.hub.constraint:𐬇𝔓蠥𑒛뼌𨏐𓂙𤸿谧𗇲顯𦬗𘉲𡬧䤮𢇥𫽑𥥣콴, mt Optional[mt{vbID=414, vbUUID=229571635143498, seqno=346, bucket=default}]
23:09:11.340 60/scala-execution-context-global-60/67044/ccc7b deleting inserted doc default.default.cihcs-Whatnot_e.NeR2huD3LRxweN3mFuI9cEhhVOzApW5w with cas 1606774151020937216
23:09:11.368 60/scala-execution-context-global-60/67044/ccc7b deleted inserted doc default.default.cihcs-Whatnot_e.NeR2huD3LRxweN3mFuI9cEhhVOzApW5w, mt Optional[mt{vbID=947, vbUUID=1968439985624, seqno=386, bucket=default}]
23:09:11.368 60/scala-execution-context-global-60/67044/ccc7b marking ATR default:default.transactions._txn:atr-414-#aeeb as rollback complete
23:09:11.401 60/scala-execution-context-global-60/67044/ccc7b rollback - atr rolled back
23:09:11.401 60/scala-execution-context-global-60/67044/ccc7b Adding cleanup request for transactions/_txn:atr-414-#aeeb to run in 30000 msecs
23:09:11.401 60/scala-execution-context-global-60/67044/ccc7b added attempt TransactionAttempt{id=ccc7b,state=ROLLED_BACK,atr=default:default.transactions._txn:atr-414-#aeeb} after error
23:09:11.401 60/scala-execution-context-global-60/67044/<> reraising original exception 'TransactionOperationFailed' com.couchbase.transactions.error.attempts.ActiveTransactionRecordNotFound: 43d01a06-cada-423f-942a-cbb5be7cc491
23:09:11.402 60/scala-execution-context-global-60/67044 TransactionOperationFailed retryTransaction=false
23:09:11.402 60/scala-execution-context-global-60/67044/ccc7b converted TransactionOperationFailed TRANSACTION_FAILED to final error com.couchbase.transactions.error.TransactionFailed: Transaction has failed with cause 'com.couchbase.transactions.error.attempts.ActiveTransactionRecordNotFound: 43d01a06-cada-423f-942a-cbb5be7cc491'
40a5a9a0-338e-45a4-bb98-94e185c1c2f7
com.couchbase.transactions.error.attempts.ActiveTransactionRecordNotFound: 40a5a9a0-338e-45a4-bb98-94e185c1c2f7
at com.couchbase.transactions.components.DocumentGetter.lambda$lookupStatusFromATR$7(DocumentGetter.java:198)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:88)
at reactor.core.publisher.FluxMap$MapSubscriber.onError(FluxMap.java:126)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:100)
at reactor.core.publisher.Operators.error(Operators.java:196)
at reactor.core.publisher.MonoError.subscribe(MonoError.java:52)
at reactor.core.publisher.Mono.subscribe(Mono.java:4213)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:97)
at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onError(FluxDoFinally.java:129)
at com.couchbase.client.core.Reactor$SilentMonoCompletionStage.lambda$subscribe$0(Reactor.java:172)
at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:859)
at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:837)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
at com.couchbase.client.core.msg.BaseRequest.succeed(BaseRequest.java:143)
at com.couchbase.client.core.io.netty.kv.KeyValueMessageHandler.decodeAndComplete(KeyValueMessageHandler.java:322)
at com.couchbase.client.core.io.netty.kv.KeyValueMessageHandler.decode(KeyValueMessageHandler.java:301)
at com.couchbase.client.core.io.netty.kv.KeyValueMessageHandler.channelRead(KeyValueMessageHandler.java:228)
at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at com.couchbase.client.core.io.netty.kv.MemcacheProtocolVerificationHandler.channelRead(MemcacheProtocolVerificationHandler.java:84)
at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at com.couchbase.client.core.deps.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
at com.couchbase.client.core.deps.io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:311)
at com.couchbase.client.core.deps.io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:425)
at com.couchbase.client.core.deps.io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at com.couchbase.client.core.deps.io.netty.handler.flush.FlushConsolidationHandler.channelRead(FlushConsolidationHandler.java:152)
at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at com.couchbase.client.core.deps.io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at com.couchbase.client.core.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at com.couchbase.client.core.deps.io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at com.couchbase.client.core.deps.io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at com.couchbase.client.core.deps.io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
at com.couchbase.client.core.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
at com.couchbase.client.core.deps.io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
at com.couchbase.client.core.deps.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at com.couchbase.client.core.deps.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at com.couchbase.client.core.deps.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at com.couchbase.client.core.deps.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:834)
- When
transactions.run
is synchronized, there is no problem. - Code never fails with
(1 to 20).foreach
(notice that there is nopar
). - Code rarely fails with
(1 to 2).par
. - Code sometimes fails with
(1 to 5).par
, but more likely. - When I create an Apache Pool with 8 Transaction objects and borrow them while using
par
, code fails just like(1 to 20).par
fails (in other words, I have 8transaction
objects and I make sure that they can not be used in parallel) - Same problem from 1.1.0 to 1.1.3.
- Transactions are set to a metadata collection that has a primary index only.
Configuration:
transactions {
# Couchbase default is 15 seconds.
expiration-time = "30 seconds"
# Couchbase default is 15 seconds.
key-value-timeout = "30 seconds"
# Couchbase default is 1000 and must be less than 20480!
maximum-number-of-transaction-records = 20480
# Couchbase default is 60 seconds.
cleanup-window = "60 seconds"
}
What does attempts.ActiveTransactionRecordNotFound
? It seems fishy to me, can transactions run in Couchbase in parallel? Why are active transaction records not being found?
Thanks!