LU-5569 ptlrpc: change reverse import life cycle
Make reverse import on server have same life cycle for a client
import, otherwise a reverse import disconnecting on each client
reconnect open several races in request sending (AST mostly) code.
First problem is send_rpc vs class_destroy_import() race. If send RPC
(or resending) issued after class_destroy_import() function it will
fail due to generation check.
The second problem is resending via a different router (to a different nid).
The target_handle_connect() function doesn't update the connection
information for older reverse import, so if the connection information
or security flavor has changed we won't be able to deliver an RPC
from server to the client.
The third problem is that connection flags aren't updated atomically
for an import. The target_handle_connect() function connects the new
import before the message header flags are set, so if we send an RPC
in that time it may have the wrong flags.
The final fourth problem is none wakeup an older RPC if client
reconnected to ability to resend after network flap. This was
not a problem without Vitaly's "resend AST callbacks" patch
(commit
30be03b4dd59389) as it was not possible to resend RPCs.
Now, however, this problem results in failing to resend ASTs at
all, or adding long timeout to AST RPCs.
Xyratex-bug-id: MRP-2038
Signed-off-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com>
Change-Id: I5dd65a0a507827d6a43683dedbbc0cee263ee0d0
Reviewed-on: http://review.whamcloud.com/11750
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>