Details
-
Bug
-
Resolution: Not a Bug
-
Major
-
None
-
None
-
None
-
1
Description
HI Graham,
CB Version : Enterprise Edition 7.1.0 build 2534
JCBC: 3.3.0
@Test
|
void userWithReadWritePermissionsCanCleanup_metadataCollection() { |
String TEST_USER = "can_read_write_customCollection"; |
User user = new User(TEST_USER); |
user.password(Strings.RBAC_USER_PASSWORD);
|
user.roles(
|
new Role("data_reader", shared.bucket().name(),defaultScopeName,customCollectionName), |
new Role("data_writer", shared.bucket().name(),defaultScopeName,customCollectionName)); |
shared.cluster().users().upsertUser(user);
|
|
try (var initiator = TransactionsInitiatorBuilder.definitelyMakeClusterConnection(shared, |
shared.getClusterHostname(),
|
TEST_USER,
|
Strings.RBAC_USER_PASSWORD)
|
.cleanupCollectionList(Arrays.asList(customCollection))
|
.cleanupLostAttempts(true) |
.cleanupWindow(CLEANUP_WINDOW)
|
.sendToPerformerIfNeeded()) {
|
assertEquals(convertTogRPCCollectionSet(Set.of(customCollection)), initiator.fetchCleanupSet());
|
|
//From default connection, create a failed transaction |
String docId = TestUtils.docId();
|
TransactionResult r1 = TransactionBuilder.create(shared)
|
.metadataCollection(customCollection)
|
.timeout(TIMEOUT)
|
.addHookAlways(HookPoint.AFTER_ATR_COMMIT, HookAction.FAIL_HARD)
|
.insert(docId, initial)
|
.sendToPerformer();
|
|
Util.waitUntilCondition(() -> {
|
long atrCount = ATRValidator.findAtrEntriesForTransaction(customCollection,r1.getTransactionId()).size(); |
return atrCount == 0; |
}, WAIT_UNTIL_TIMEOUT);
|
|
DocValidator.assertDocExistsAndNotInTransactionAndContentEquals(collection, docId,initial);
|
initiator.setUsed();
|
}
|
}
|
Error Logs:
08:18:43.660 [cb-events] DEBUG com.couchbase.transactions.cleanup - [com.couchbase.transactions.cleanup][TransactionCleanupAttemptEvent] Transaction cleanup attempt failed, isRegular=false, logs=[08:18:41.054 442/cb-txn-cleanup-27/<ud>d/ddec2 Cleaning up ATR entry (isRegular=false) CleanupRequest(atrId=_txn:atr-180-#ba3,attemptId=ddec2822-90c2-48e3-886d-4d2ae82d0639,state=COMMITTED,inserts=[<ud>default</ud>.<ud>52808489-e172-45b8-867b-f6504b6eef89</ud>],replaces=[],removes=[],ageMillis=5211,fc=Optional[],durability=Optional[MAJORITY]); 08:18:43.560 1100/cb-timer-134-1/<ud>d/ddec2 got exception while handling doc <ud>default.Optional[_default].Optional[_default].52808489-e172-45b8-867b-f6504b6eef89</ud>: <ud>com.couchbase.client.core.error.UnambiguousTimeoutException: SubdocGetRequest, Reason: TIMEOUT {"cancelled":true,"clientContext":{"txn.op":"DocumentGetter::justGetDoc"},"completed":true,"coreId":"0x3a4641d500000022","idempotent":true,"lastChannelId":"3A4641D500000022/000000003C8B7D1F","lastDispatchedFrom":"127.0.0.1:64691","lastDispatchedTo":"localhost:11210","reason":"TIMEOUT","requestId":360449,"requestType":"SubdocGetRequest","retried":14,"retryReasons":["KV_COLLECTION_OUTDATED"],"service":{"bucket":"default","collection":"_default","documentId":"<ud>52808489-e172-45b8-867b-f6504b6eef89</ud>","errorCode":{"description":"Operation specified an unknown collection.","name":"UNKNOWN_COLLECTION"},"opaque":"0x58110","scope":"_default","type":"kv","vbucket":52},"timeoutMs":2500,"timings":{"dispatchMicros":843,"encodingMicros":0,"totalDispatchMicros":9837,"totalServerMicros":7,"totalMicros":2506040,"serverMicros":0}}</ud> no cause stacktrace:; 08:18:43.560 1100/cb-timer-134-1/<ud>d/ddec2 error while attempting to cleanup ATR entry <ud>default:_default.CleanupForSDKIntegratedLibrariesTestcollection._txn:atr-180-#ba3</ud>, entry is 0 mins old, cleanup will retry later: <ud>com.couchbase.client.core.error.UnambiguousTimeoutException: SubdocGetRequest, Reason: TIMEOUT {"cancelled":true,"clientContext":{"txn.op":"DocumentGetter::justGetDoc"},"completed":true,"coreId":"0x3a4641d500000022","idempotent":true,"lastChannelId":"3A4641D500000022/000000003C8B7D1F","lastDispatchedFrom":"127.0.0.1:64691","lastDispatchedTo":"localhost:11210","reason":"TIMEOUT","requestId":360449,"requestType":"SubdocGetRequest","retried":14,"retryReasons":["KV_COLLECTION_OUTDATED"],"service":{"bucket":"default","collection":"_default","documentId":"<ud>52808489-e172-45b8-867b-f6504b6eef89</ud>","errorCode":{"description":"Operation specified an unknown collection.","name":"UNKNOWN_COLLECTION"},"opaque":"0x58110","scope":"_default","type":"kv","vbucket":52},"timeoutMs":2500,"timings":{"dispatchMicros":843,"encodingMicros":0,"totalDispatchMicros":9837,"totalServerMicros":7,"totalMicros":2506040,"serverMicros":0}}</ud> no cause stacktrace:]
|
08:18:43.660 [cb-events] INFO c.c.transactions.cleanup.stats - [com.couchbase.transactions.cleanup.stats][TransactionCleanupEndRunEvent] start={default._default.CleanupForSDKIntegratedLibrariesTestcollection/clientId=b0dd0,index=0,numClients=1,ATRs={checking=1024,total=1024},runLength=2000millis},end={taken=2860millis,ATRs={tried=1024,present=69,errored=0},entries={expired=1,failed=0,total=1},largestNumEntries=1,oldest=5211millis,id=_txn:atr-180-#ba3/ddec2}}
|
08:18:43.660 [cb-events] TRACE c.c.transactions.cleanup.lost - [com.couchbase.transactions.cleanup.lost][LogEvent] lost/default._default.CleanupForSDKIntegratedLibrariesTestcollection/clientId=b0dd0 processed ATR <ud>default:_default.CleanupForSDKIntegratedLibrariesTestcollection._txn:atr-180-#ba3</ud> after 2507278µs (230 fetching ATR), CAS=REAL: stats={entries=1,expired=1}
|
08:18:43.661 [cb-events] WARN com.couchbase.config - [com.couchbase.config][CollectionMapRefreshFailedEvent][2506ms] Collection Map refresh (CollectionIdentifier{bucket='default', scope=Optional[_default], collection=Optional[_default], isDefault=true}) failed: FAILED {"coreId":"0x3a4641d500000022"}
|
com.couchbase.client.core.error.UnambiguousTimeoutException: GetCollectionIdRequest, Reason: TIMEOUT {"cancelled":true,"completed":true,"coreId":"0x3a4641d500000022","idempotent":true,"lastChannelId":"3A4641D500000022/000000003C8B7D1F","lastDispatchedFrom":"127.0.0.1:64691","lastDispatchedTo":"localhost:11210","reason":"TIMEOUT","requestId":360450,"requestType":"GetCollectionIdRequest","retried":14,"retryReasons":["KV_COLLECTION_OUTDATED"],"service":{"bucket":"default","collection":"_default","errorCode":{"description":"Operation specified an unknown collection.","name":"UNKNOWN_COLLECTION"},"opaque":"0x58111","scope":"_default","type":"kv","vbucket":0},"timeoutMs":2500,"timings":{"dispatchMicros":828,"totalDispatchMicros":9666,"totalServerMicros":0,"serverMicros":0}}
|
at com.couchbase.client.core.msg.BaseRequest.cancel(BaseRequest.java:184) ~[classes/:na]
|
at com.couchbase.client.core.msg.Request.cancel(Request.java:70) ~[classes/:na]
|