docs: function(agent, id, type, info) {
    if (type === 'client') {
      delete agent.clients[id];
    } else {
      // remove master node in idMap and typeMap
      let record = agent.idMap[id];
      if (!record) {
        return;
      }
      let _info = record['info']; // info {host, port}
      if (utils.compareServer(_info, info)) {
        delete agent.idMap[id];
        let list = agent.typeMap[type];
        if (list) {
          for (let i = 0, l = list.length; i < l; i++) {
            if (list[i].id === id) {
              list.splice(i, 1);
              break;
            }
          }
          if (list.length === 0) {
            delete agent.typeMap[type];
          }
        }
      } else {
        // remove slave node in slaveMap
        let slaves = agent.slaveMap[id];
        if (slaves) {
          for (let i = 0, l = slaves.length; i < l; i++) {
            if (utils.compareServer(slaves[i]['info'], info)) {
              slaves.splice(i, 1);
              break;
            }
          }
          if (slaves.length === 0) {
            delete agent.slaveMap[id];
          }
        }
      }
    }
  }