When protocol closes DCB it calls dcb_close instead of dcb->func.close. dcb_close then calls dcb->func.close. This is now changed to all protocols and routers.
Rwsplit handles ERRACT_NEW_CONNECTION by clearing backend reference, removing callbacks and associating backend reference with new backend server. If it succeeds and the router session can continue, handleError returns true. Otherwise false. When ever false is returned it means that session must be closed. Rwsplit now tolerates backend failures in a way that it searches new backends when monitor, backend, or client operation fails due to backend failure.
This commit is contained in:
@ -66,6 +66,12 @@ typedef void *ROUTER;
|
||||
*
|
||||
* @see load_module
|
||||
*/
|
||||
typedef enum error_action {
|
||||
ERRACT_NEW_CONNECTION = 0x001,
|
||||
ERRACT_REPLY_CLIENT = 0x002
|
||||
} error_action_t;
|
||||
|
||||
|
||||
typedef struct router_object {
|
||||
ROUTER *(*createInstance)(SERVICE *service, char **options);
|
||||
void *(*newSession)(ROUTER *instance, SESSION *session);
|
||||
@ -75,12 +81,12 @@ typedef struct router_object {
|
||||
void (*diagnostics)(ROUTER *instance, DCB *dcb);
|
||||
void (*clientReply)(ROUTER* instance, void* router_session, GWBUF* queue, DCB *backend_dcb);
|
||||
void (*handleError)(
|
||||
ROUTER* instance,
|
||||
void* router_session,
|
||||
char* message,
|
||||
DCB *backend_dcb,
|
||||
int action,
|
||||
bool* succp);
|
||||
ROUTER* instance,
|
||||
void* router_session,
|
||||
GWBUF* errmsgbuf,
|
||||
DCB* backend_dcb,
|
||||
error_action_t action,
|
||||
bool* succp);
|
||||
uint8_t (*getCapabilities)(ROUTER *instance, void* router_session);
|
||||
} ROUTER_OBJECT;
|
||||
|
||||
@ -97,10 +103,6 @@ typedef enum router_capability_t {
|
||||
RCAP_TYPE_PACKET_INPUT = (1 << 1)
|
||||
} router_capability_t;
|
||||
|
||||
typedef enum error_action {
|
||||
ERRACT_NEW_CONNECTION = 0x001,
|
||||
ERRACT_REPLY_CLIENT = 0x002
|
||||
} error_action_t;
|
||||
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user