idr can timeout and wrap/be reused quite quickly.
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 9 Jun 2010 06:12:36 +0000 (16:12 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 9 Jun 2010 06:19:29 +0000 (16:19 +1000)
commit2f6a870d7ff02ceb61fde242f752dccbfcb4cb37
treea87c7a126bd6083c15c4917894785c9367cc8d26
parent9b4a83e49c5df80df8498b7384c5f53f390c1d9d
idr can timeout and wrap/be reused quite quickly.

If a noremote node hangs for an extended period, it is possible
that we might have a DMASTER request in flight for record A to that node.
Eventually we will reuse the idr, and may reuse it for a DMASTER request to a different node for a different record B.

If while the request for B is in flight,  the first tnode un-hangs and responds back
we would receive a dmaster reply for the wrong record.

This would cause a record to become perpetually locked, since inside the daemon we would tdb_chainlock(dmaster_reply->pdu->key)   but once the migration would complete we would chainunlock   idr->state->call->key

Adding code to verify that when we receive a dmaster reply packet that it does in fact match the exact same key that the state variable we have for the idr in flight.
server/ctdb_call.c