A computer program product, comprising a non-transitory computer-readable medium having a computer-readable program code embodied therein, the computer-readable program code adapted to be executed by one or more processors to implement a method for maintaining consistency in a distributed file system of a cluster for a plurality of clients that access files via a stateful protocol, the method comprising:
- hosting different logical partitions representing parts of a global namespace on some nodes of the cluster, and file content and shadow logical partitions corresponding to the different logical partitions on other nodes, the some nodes being metadata nodes and the other nodes being data nodes, each file thereby being associated with a pair of nodes comprising a metadata and data node;
- establishing Transmission Control Protocol (TCP) links between the metadata and data nodes;
- upon opening one or more files in response to file system operations requested by the clients, generating a file manager server session between each pair of nodes associated with the files to track open states of the files;
- recording each file manager server session in a mapping table, the mapping table thereby identifying each open file, and each particular pair of nodes associated with each open file;
- detecting that one of a metadata or data node of a particular pair of nodes associated with an open file has become unavailable because a TCP link between the particular pair of nodes has broken, another of the metadata or data node remaining available;
- consulting the mapping table to identify the other of the metadata or data node, and the open file;
- and
- performing crash recovery protocols on the other of the metadata or data node associated with the open file while not performing the crash recovery protocols for the open file on any other available node in the cluster.