Apologies if this is not the proper channel, if so please direct me accordingly...

When I test Sequoia with concurrent requests, I (almost always) get this exception:
java.sql.SQLException: A query with id 0 has already been scheduled
This is occurring in AbstractScheduler.scheduleReadRequest(), because there is already an id=0 request in activeReadRequests.

My configuration is: a single JBoss (4.05) talking to a single Sequoia (3.0 Beta 2) controller with two MySQL (5.0.41) backends.

Poking around in the Sequoia source code, and running it under the debugger, I notice that "AbstractRequest.id" is not set for many (if not all) queries. Under light or non-concurrent load this is not a problem, but with concurrent requests, sooner or later the scheduler is presented with one of these id=0 requests before it has had time to remove the previous one. Result: the exception I am seeing.

The problem goes away if I unconditionally set the id in VirtualDatabaseWorkerThread.setRequestParameters(), i.e., instead of this:
    if (request.isAutoCommit() && transactionStarted)
    {
      vdb.commit(tid, writeQueryExecutedInThisTransaction,
          !queryExecutedInThisTransaction);
      return false;
    }
    else
      request.setTransactionId(tid);
    request.setId(vdb.getNextRequestId());
    return transactionStarted;
do this:
    request.setId(vdb.getNextRequestId());
    if (request.isAutoCommit() && transactionStarted)
    {
      vdb.commit(tid, writeQueryExecutedInThisTransaction,
          !queryExecutedInThisTransaction);
      return false;
    }
    else
      request.setTransactionId(tid);
    return transactionStarted;

but this is just a kludge to illustrate my problem and hopefully point the way to a solution.
Is this a known problem? Or maybe I have configured things incorrectly?

_______________________________________________
Sequoia mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/sequoia

Reply via email to