Just to clarify what is happening here
1- you are preparing or executing a whole bunch of queries against buckets that are not known to the query service
(that's the "keyspace xxx not found" messages)
2- since the buckets are not found the couchbase datastore layer refreshes the whole default pool to see if they can be found
(that's the "Retrying bucket xxx" messages)
3- the buckets are still not found (note the lack of "Created new bucket xxx" messages)
4- since the pool has been refreshed, a new `travel-sample` bucket structure has been created. as part of this, connections are being migrated from the old to the new bucket structure.
5- you now query `travel-sample`: you are either hitting the old bucket, which no longer has a connection pool, or the new bucket, which doesn't yet have a connection pool - either way you will get error 12008 until the old bucket has gone and the new bucket gets the connection pools.
I can minimize the number of "Pool Get returned travel-sample: no connection pool" messages.
I can mark the old bucket as unusable.
I can lower the number of refreshes, by say failing searching for non existing buckets if a refresh had already been done in the last 100ms.
I can get the 12008 to lower in number, in short, improve on the experience by fixing MB-39804.
All this said, the fact still remains that you have triggered a whole pool refresh - in fact, a lot of pool refreshes - by querying non existing keyspaces, and this will lead to 12008 as a result of the bucket being refreshed.
Bear in mind that the more pool refreshes you trigger, the more 12008 you get, because connection pools have to be moved from bucket structure to bucket structure to bucket structure and so on.
What you have to do is fix your test in such a way that you don't query non existent keyspaces.
On that front - I have the idea that you expect these keyspaces to exist: could it be that they are collections sitting inside `travel-sample` and you have forgot to set query_context?