Details
Description
The linked JSCBC-908 is marked as resolved however I can still reproduce the issue. The issue is in lcb. It retries the request when read only is true and 0 results are returned.
To reproduce with a real cluster
TEST_F(QueryUnitTest, testReadOnlyWithNoResults)
|
{
|
lcb_INSTANCE *instance;
|
HandleWrap hw;
|
if (!createClusterQueryConnection(hw, &instance)) {
|
SKIP_CLUSTER_QUERY_TEST();
|
}
|
N1QLResult res;
|
std::string query = "SELECT * from " + MockEnvironment::getInstance()->getBucket() + " limit 0";
|
makeCommand(query.c_str());
|
lcb_cmdquery_readonly(cmd, 1);
|
lcb_cmdquery_timeout(cmd, LCB_MS2US(3000));
|
lcb_STATUS rc = lcb_query(instance, &res, cmd);
|
ASSERT_STATUS_EQ(LCB_SUCCESS, rc);
|
lcb_wait(instance, LCB_WAIT_DEFAULT);
|
ASSERT_STATUS_EQ(LCB_SUCCESS, res.rc);
|
ASSERT_EQ(0, res.rows.size());
|
}
|
Expected equality of these values:
LCB_SUCCESS
Which is: 0
actual_code__181
Which is: 201
LCB_SUCCESS (0) != LCB_ERR_TIMEOUT (201)
Remove lcb_cmdquery_readonly(cmd, 1); and the test passes
Attachments
Issue Links
- causes
-
JSCBC-908 Timeout with no matching documents
-
- Resolved
-