title: what happens if a replica leader in kafka dies after committing a message but before sending Highwater mark to ISR replicas?
body: <p>From various documentation, I found that after getting acknowledgement from all the ISRs, kafka replica leader sends response back to the producer. After that, the leader periodically broadcast the HW(high water mark) to replicas. (correct me if I am wrong!)</p>
  
  <p>Now, if a leader dies before broadcasting the HW, then the committed message will be lost. because new leader will discard all the message after its HW which was lagging from previous leader. </p>
  
  <p>How does kafka ensure that this scenario never happens? according to kafka documentation, once a message is committed by the leader, it is persistent, never gets lost.</p>