From b758dc1a4a8a5412787da5a5beafbca27f96035c Mon Sep 17 00:00:00 2001 From: Mark Riddoch Date: Mon, 26 Jan 2015 11:23:46 +0000 Subject: [PATCH] Clear residual buffered data when reconnecting to the master in all cases --- server/modules/routing/binlog/blr_master.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/modules/routing/binlog/blr_master.c b/server/modules/routing/binlog/blr_master.c index c05a77eae..e992c6f21 100644 --- a/server/modules/routing/binlog/blr_master.c +++ b/server/modules/routing/binlog/blr_master.c @@ -104,6 +104,15 @@ GWBUF *buf; return; } router->master_state = BLRM_CONNECTING; + + /* Discard the queued residual data */ + buf = router->residual; + while (buf) + { + buf = gwbuf_consume(buf, GWBUF_LENGTH(buf)); + } + router->residual = NULL; + spinlock_release(&router->lock); if ((client = dcb_alloc(DCB_ROLE_INTERNAL)) == NULL) {