code: def test_recover_dead_node(tmp_path: pathlib.Path):
      assert_project_root()
  
      peer_api_uris, peer_dirs, bootstrap_uri = start_cluster(
          tmp_path, N_PEERS
      )
  
      create_collection(peer_api_uris[0])
      wait_collection_exists_and_active_on_all_peers(
          collection_name="test_collection", peer_api_uris=peer_api_uris
      )
      upsert_points(peer_api_uris[0], "Paris")
  
      search_result = search(peer_api_uris[0], "Paris")
      assert len(search_result) > 0
  
      # Kill last peer
  
      p = processes.pop()
      p.kill()
  
      # Validate search works with the dead node
      search_result = search(peer_api_uris[0], "Paris")
      assert len(search_result) > 0
  
      # Validate upsert works with the dead node
      upsert_points(peer_api_uris[0], "Berlin")
  
      # Assert that there are dead replicas
      wait_for_some_replicas_not_active(
          peer_api_uris[0], "test_collection"
      )
  
      # Assert all records were changed
      search_result = search(peer_api_uris[0], "Paris")
      assert len(search_result) == 0
  
      # Apply cluster update operation to leaving part of the cluster
      # 2 nodes majority should be enough for applying the status
      create_collection(peer_api_uris[0], "test_collection2", timeout=5)
  
      new_url = start_peer(
          peer_dirs[-1], f"peer_0_restarted.log", bootstrap_uri
      )
  
      # Wait for cluster to recover dead peers
      wait_for_all_replicas_active(peer_api_uris[0], "test_collection")
  
      # Assert all records were changed
      search_result = search(peer_api_uris[0], "Paris")
      assert len(search_result) == 0
  
      # Assert all records were changed
      search_result = search(peer_api_uris[0], "Berlin")
      assert len(search_result) > 0
  
      # Assert the replication is consistent regardless of the entry point.
      assert search(peer_api_uris[0], "Paris") == search(
          new_url, "Paris"
      )
  
      wait_collection_on_all_peers(
          "test_collection2", peer_api_uris[:-2] + [new_url]
      )
  
imports: import pathlib
  from .utils import *
  from .assertions import assert_http_ok
label_desc: Use image node_id 4 for calling a global function with example usage: test_recover_dead_node(tmp_path) without return types