git clone https://github.com/cbjs-dev/cbjs.git
cd cbjs
nvm install && nvm use
git checkout vitest/keyspace-isolation
pnpm i
pnpm run build
CBPPLOGLEVEL=trace vitest --project=project:keyspace-isolation --run
When you checkout the repo, it will work.
Open the file packages/vitest/src/keyspaceIsolation/KeyspaceIsolationPool.ts
and go to line 364
.
// This works
this.clusterPromise = sleep(500).then(() =>
connect(params.connectionString, params.credentials)
);
// This crashes
this.clusterPromise = connect(params.connectionString, params.credentials);
I get this trace :
[2024-04-29 10:42:27.784] 1ms [trac] [61894,1121462] [949814-f7e9-e14c-2b7b-ab21f8f573032e/fe28b9-9a59-3d43-2489-94e174447b56cc/plain/cbjs_b_638749ac] <localhost/::1:11210> MCBP recv {magic=0x18, opcode=0x1f, fextlen=3, keylen=0, extlen=0, datatype=0, status=0, bodylen=41, opaque=8, cas=0}
[2024-04-29 10:42:27.784] 0ms [debu] [61894,1121462] [949814-f7e9-e14c-2b7b-ab21f8f573032e/fe28b9-9a59-3d43-2489-94e174447b56cc/plain/cbjs_b_638749ac] <localhost/::1:11210> supported_features=[tcp_nodelay, mutation_seqno, xattr, xerror, select_bucket, snappy, json, duplex, clustermap_change_notification, unordered_execution, tracing, alt_request_support, sync_replication, collections, preserve_ttl, vattr, subdoc_create_as_deleted, subdoc_replica_read, deduplicate_not_my_vbucket_clustermap]
[2024-04-29 10:42:27.784] 0ms [trac] [61894,1121462] [949814-f7e9-e14c-2b7b-ab21f8f573032e/fe28b9-9a59-3d43-2489-94e174447b56cc/plain/cbjs_b_638749ac] <localhost/::1:11210> MCBP recv {magic=0x18, opcode=0x20, fextlen=3, keylen=0, extlen=0, datatype=0, status=0, bodylen=45, opaque=9, cas=0}
[2024-04-29 10:42:27.784] 0ms [trac] [61894,1121462] [949814-f7e9-e14c-2b7b-ab21f8f573032e/fe28b9-9a59-3d43-2489-94e174447b56cc/plain/cbjs_b_638749ac] <localhost/::1:11210> MCBP recv {magic=0x18, opcode=0x21, fextlen=3, keylen=0, extlen=0, datatype=0, status=33, bodylen=183, opaque=10, cas=0}
[2024-04-29 10:42:27.784] 0ms [trac] [61894,1121462] decoding attribute list [r=0x18 0x63 0x1f 0x5a 0xffffff99 0xffffffbb 0xffffffc6 0xffffffba5dcaa6816eb8e3e2,s=q4koz+brR1CfUDLRXShQylNrSRZpMy57yvdRAsCK1ZGyycPBV1572fu2RAXLS0vfXWtzw552z1ARePhjATVw+w==,i=15000]
[2024-04-29 10:42:27.790] 6ms [trac] [61894,1121462] [949814-f7e9-e14c-2b7b-ab21f8f573032e/fe28b9-9a59-3d43-2489-94e174447b56cc/plain/cbjs_b_638749ac] <localhost/::1:11210> MCBP send {magic=0x80, opcode=0x22, fextlen=0, keylen=12, extlen=0, datatype=0, vbucket=0, bodylen=191, opaque=11, cas=0}
[2024-04-29 10:42:27.791] 0ms [trac] [61894,1121462] [949814-f7e9-e14c-2b7b-ab21f8f573032e/fe28b9-9a59-3d43-2489-94e174447b56cc/plain/cbjs_b_638749ac] <localhost/::1:11210> MCBP recv {magic=0x18, opcode=0x22, fextlen=3, keylen=0, extlen=0, datatype=0, status=0, bodylen=93, opaque=11, cas=0}
[2024-04-29 10:42:27.791] 0ms [trac] [61894,1121462] [949814-f7e9-e14c-2b7b-ab21f8f573032e/fe28b9-9a59-3d43-2489-94e174447b56cc/plain/cbjs_b_638749ac] <localhost/::1:11210> MCBP send {magic=0x80, opcode=0xfe, fextlen=0, keylen=0, extlen=0, datatype=0, vbucket=0, bodylen=2, opaque=12, cas=0}
[2024-04-29 10:42:27.791] 0ms [trac] [61894,1121462] [949814-f7e9-e14c-2b7b-ab21f8f573032e/fe28b9-9a59-3d43-2489-94e174447b56cc/plain/cbjs_b_638749ac] <localhost/::1:11210> MCBP send {magic=0x80, opcode=0x89, fextlen=0, keylen=15, extlen=0, datatype=0, vbucket=0, bodylen=15, opaque=13, cas=0}
[2024-04-29 10:42:27.791] 0ms [trac] [61894,1121462] [949814-f7e9-e14c-2b7b-ab21f8f573032e/fe28b9-9a59-3d43-2489-94e174447b56cc/plain/cbjs_b_638749ac] <localhost/::1:11210> MCBP send {magic=0x80, opcode=0xb5, fextlen=0, keylen=0, extlen=0, datatype=0, vbucket=0, bodylen=0, opaque=14, cas=0}
[2024-04-29 10:42:27.791] 0ms [trac] [61894,1121462] [949814-f7e9-e14c-2b7b-ab21f8f573032e/fe28b9-9a59-3d43-2489-94e174447b56cc/plain/cbjs_b_638749ac] <localhost/::1:11210> MCBP recv {magic=0x18, opcode=0xfe, fextlen=3, keylen=0, extlen=0, datatype=1, status=0, bodylen=9671, opaque=12, cas=0}
[2024-04-29 10:42:27.791] 0ms [trac] [61894,1121462] [949814-f7e9-e14c-2b7b-ab21f8f573032e/fe28b9-9a59-3d43-2489-94e174447b56cc/plain/cbjs_b_638749ac] <localhost/::1:11210> MCBP recv {magic=0x18, opcode=0x89, fextlen=3, keylen=0, extlen=0, datatype=0, status=36, bodylen=3, opaque=13, cas=0}
[2024-04-29 10:42:27.791] 0ms [debu] [61894,1121462] [949814-f7e9-e14c-2b7b-ab21f8f573032e/fe28b9-9a59-3d43-2489-94e174447b56cc/plain/cbjs_b_638749ac] <localhost/::1:11210> unable to select bucket: cbjs_b_638749ac, probably the bucket does not exist
[2024-04-29 10:42:27.791] 0ms [debu] [61894,1121462] all nodes failed to bootstrap, triggering DNS-SRV refresh, ec=bucket_not_found (10), last endpoint="localhost:11210"
[2024-04-29 10:42:27.791] 0ms [warn] [61894,1121462] [949814-f7e9-e14c-2b7b-ab21f8f573032e/fe28b9-9a59-3d43-2489-94e174447b56cc/plain/cbjs_b_638749ac] <localhost/::1:11210> failed to bootstrap session ec=bucket_not_found (10), bucket="cbjs_b_638749ac"
[2024-04-29 10:42:27.791] 0ms [debu] [61894,1121462] [949814-f7e9-e14c-2b7b-ab21f8f573032e/fe28b9-9a59-3d43-2489-94e174447b56cc/plain/cbjs_b_638749ac] <localhost/::1:11210> stop MCBP connection, reason=node_not_available
[2024-04-29 10:42:27.791] 0ms [debu] [61894,1121462] Query DNS-SRV: address="localhost", service="_couchbase", nameserver="1.1.1.1:53"
[2024-04-29 10:42:27.791] 0ms [trac] [61894,1121462] Query DNS-SRV (UDP) address="1.1.1.1:53", udp_timeout=250ms, total_timeout=500ms
[2024-04-29 10:42:27.791] 0ms [debu] [61894,1121462] [949814-f7e9-e14c-2b7b-ab21f8f573032e/fe28b9-9a59-3d43-2489-94e174447b56cc/plain/cbjs_b_638749ac] <localhost/::1:11210> destroy MCBP connection
This could be related to CXXCBC-503 but I had similar issue consistently before ( see packages/vitest/src/ServerTestContext.ts
).