mirror of
https://github.com/samba-team/samba.git
synced 2025-03-20 22:50:26 +03:00
discard REQ/REPLY DMASTER when generation id is wrong or when in
recovery mode (This used to be ctdb commit bfd6d430f22e38cff1d64510dc447cfbe1dab35f)
This commit is contained in:
parent
c06c1e1f9f
commit
a1cac30684
@ -245,11 +245,11 @@ void ctdb_recv_pkt(struct ctdb_context *ctdb, uint8_t *data, uint32_t length)
|
||||
is running in the same generation instance as this node
|
||||
*/
|
||||
if (ctdb->vnn_map->generation != hdr->generation) {
|
||||
DEBUG(0,(__location__ " ctdb request %d of type"
|
||||
" %d length %d from node %d to %d had an"
|
||||
DEBUG(0,(__location__ " ctdb request %d"
|
||||
" length %d from node %d to %d had an"
|
||||
" invalid generation id:%d while our"
|
||||
" generation id is:%d\n",
|
||||
hdr->reqid, hdr->operation, hdr->length,
|
||||
hdr->reqid, hdr->length,
|
||||
hdr->srcnode, hdr->destnode,
|
||||
ctdb->vnn_map->generation,
|
||||
hdr->generation));
|
||||
@ -259,10 +259,10 @@ void ctdb_recv_pkt(struct ctdb_context *ctdb, uint8_t *data, uint32_t length)
|
||||
until the cluster has recovered.
|
||||
*/
|
||||
if (ctdb->recovery_mode != CTDB_RECOVERY_NORMAL) {
|
||||
DEBUG(0,(__location__ " ctdb request %d of type"
|
||||
" %d length %d from node %d to %d"
|
||||
DEBUG(0,(__location__ " ctdb request %d"
|
||||
" length %d from node %d to %d"
|
||||
" while we are in recovery mode\n",
|
||||
hdr->reqid, hdr->operation, hdr->length,
|
||||
hdr->reqid, hdr->length,
|
||||
hdr->srcnode, hdr->destnode));
|
||||
break;
|
||||
}
|
||||
@ -282,11 +282,63 @@ void ctdb_recv_pkt(struct ctdb_context *ctdb, uint8_t *data, uint32_t length)
|
||||
break;
|
||||
|
||||
case CTDB_REQ_DMASTER:
|
||||
/* verify that the remote node that sent us dmaster req
|
||||
is running in the same generation instance as this node
|
||||
*/
|
||||
if (ctdb->vnn_map->generation != hdr->generation) {
|
||||
DEBUG(0,(__location__ " ctdb dmaster request %d"
|
||||
" length %d from node %d to %d had an"
|
||||
" invalid generation id:%d while our"
|
||||
" generation id is:%d\n",
|
||||
hdr->reqid, hdr->length,
|
||||
hdr->srcnode, hdr->destnode,
|
||||
ctdb->vnn_map->generation,
|
||||
hdr->generation));
|
||||
break;
|
||||
}
|
||||
/* if we are in recovery mode we discard all traffic
|
||||
until the cluster has recovered.
|
||||
*/
|
||||
if (ctdb->recovery_mode != CTDB_RECOVERY_NORMAL) {
|
||||
DEBUG(0,(__location__ " ctdb dmaster request %d"
|
||||
" length %d from node %d to %d"
|
||||
" while we are in recovery mode\n",
|
||||
hdr->reqid, hdr->length,
|
||||
hdr->srcnode, hdr->destnode));
|
||||
break;
|
||||
}
|
||||
|
||||
ctdb->status.count.req_dmaster++;
|
||||
ctdb_request_dmaster(ctdb, hdr);
|
||||
break;
|
||||
|
||||
case CTDB_REPLY_DMASTER:
|
||||
/* verify that the remote node that sent us dmaster reply
|
||||
is running in the same generation instance as this node
|
||||
*/
|
||||
if (ctdb->vnn_map->generation != hdr->generation) {
|
||||
DEBUG(0,(__location__ " ctdb dmaster reply %d"
|
||||
" length %d from node %d to %d had an"
|
||||
" invalid generation id:%d while our"
|
||||
" generation id is:%d\n",
|
||||
hdr->reqid, hdr->length,
|
||||
hdr->srcnode, hdr->destnode,
|
||||
ctdb->vnn_map->generation,
|
||||
hdr->generation));
|
||||
break;
|
||||
}
|
||||
/* if we are in recovery mode we discard all traffic
|
||||
until the cluster has recovered.
|
||||
*/
|
||||
if (ctdb->recovery_mode != CTDB_RECOVERY_NORMAL) {
|
||||
DEBUG(0,(__location__ " ctdb dmaster reply %d "
|
||||
" length %d from node %d to %d"
|
||||
" while we are in recovery mode\n",
|
||||
hdr->reqid, hdr->length,
|
||||
hdr->srcnode, hdr->destnode));
|
||||
break;
|
||||
}
|
||||
|
||||
ctdb->status.count.reply_dmaster++;
|
||||
ctdb_reply_dmaster(ctdb, hdr);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user