MXS-2555 Fix split packet bug in smart session.

The test failed to notice that the split request session was left in a
bad state after the split query had (succesfully) finished.
This commit is contained in:
Niclas Antti
2019-06-19 00:37:06 +03:00
parent 6ba1c277be
commit ef3136c5c9

View File

@ -451,7 +451,7 @@ bool SmartRouterSession::write_to_all(GWBUF* pBuf, Mode mode)
auto& cluster = *it;
cluster.tracker = maxsql::PacketTracker(pBuf);
cluster.is_replying_to_client = false;
auto pBuf_send = (std::next(it) == end(m_clusters)) ? pBuf : gwbuf_clone(pBuf);
auto pBuf_send = (next(it) == end(m_clusters)) ? pBuf : gwbuf_clone(pBuf);
if (!cluster.pDcb->func.write(cluster.pDcb, pBuf_send))
{
success = false;
@ -484,7 +484,9 @@ bool SmartRouterSession::write_split_packets(GWBUF* pBuf)
{
auto& cluster = **it;
auto pBuf_send = (std::next(it) == end(active)) ? pBuf : gwbuf_clone(pBuf);
cluster.tracker.update_request(pBuf);
auto pBuf_send = (next(it) == end(active)) ? pBuf : gwbuf_clone(pBuf);
if (!cluster.pDcb->func.write(cluster.pDcb, pBuf_send))
{
success = false;