Failure of relay nodes in a cluster-based WSN is catastrophic as they act as cluster heads that are responsible for collecting sensed data, aggregate them and send to a sink. Therefore, fault tolerance of relay nodes is an important issue in cluster based WSNs. In this paper, we present a distributed algorithm to detect faulty relay nodes with Om message complexity where m is the number of relay nodes. It is shown that the proposed algorithm can detect any relay node with transient or permanent fault based on neighbouring table information. We also propose a distributed algorithm for local recovery of the member sensor nodes of a failed relay node with message exchange complexity of On where n is the number of sensor nodes. The proposed algorithms are simulated extensively using Weibull distribution under several scenarios of WSN and compared with existing algorithms to show its superiority.