Read-write split router doesn't handle QUERY_TYPE_SESSION_WRITE in any special way. Behavior defaults to same as in the case of QUERY_TYPE_WRITE. That is, modification is executed in master only.

This commit is contained in:
vraatikka
2013-12-09 15:30:47 +02:00
parent 10eafd61bc
commit a673fc9c48

View File

@ -590,15 +590,40 @@ static int routeQuery(
case QUERY_TYPE_SESSION_WRITE: case QUERY_TYPE_SESSION_WRITE:
/**
* Update connections which are used in this session.
*
* For each connection, add a flag which indicates that
* OK Packet must arrive for this command before server
* in question is allowed to be used by router. That is,
* maintain a queue of pending OK packets and remove item
* from queue by FIFO.
*
* Return when the master responds OK Packet. Send that
* OK packet back to client.
*
* Suppress OK packets sent to MaxScale by slaves.
*
* Open questions:
* How to handle interleaving session write
* and queries? It would be simple if OK must be received
* from all/both servers before continuing query execution.
* How to maintain the order of operations? Execution queue
* would solve the problem. In the queue some things must be
* executed in serialized manner while some could be executed
* in parallel. Queries mostly.
*
* Instead of waiting for the OK packet from the master, the
* first OK packet could also be sent to client. TBD.
* vraa 9.12.13
*
*/
#if defined(FULL_RWSPLIT)
skygw_log_write(LOGFILE_TRACE, skygw_log_write(LOGFILE_TRACE,
"%lu [routeQuery:rwsplit] Query type\t%s, " "%lu [routeQuery:rwsplit] Query type\t%s, "
"routing to all servers.", "routing to all servers.",
pthread_self(), pthread_self(),
STRQTYPE(qtype)); STRQTYPE(qtype));
/**
* TODO! Connection to all servers must be established, and
* the command must be executed in them.
*/
bufcopy = gwbuf_clone(querybuf); bufcopy = gwbuf_clone(querybuf);
@ -630,7 +655,9 @@ static int routeQuery(
atomic_add(&inst->stats.n_all, 1); atomic_add(&inst->stats.n_all, 1);
goto return_ret; goto return_ret;
break; break;
#else
/** fall through */
#endif
default: default:
skygw_log_write(LOGFILE_TRACE, skygw_log_write(LOGFILE_TRACE,
"%lu [routeQuery:rwsplit] Query type\t%s, " "%lu [routeQuery:rwsplit] Query type\t%s, "