ES's synchronisation is not really anything like 2PC, if only because it has a single phase
If the primary dies at phase 2 then a replica is promoted to primary in its place. The operation was indexed on the now-dead primary but not the replica, nor was it acked to the client.
If the primary dies at phase 4 then a replica is promoted to primary in its place. The other replicas then roll back to an earlier state and recover any missing operations from the new primary so as to be sure that they end up in the same state.
In both cases the client might see an exception, or Elasticsearch might retry the operation on the new primary and return a successful response to the client.