public void remoteAck ( final long seq ) { //In replicated only master will be doing this. m_es . execute ( new Runnable ( ) { @ Override public void run ( ) { try { // ENG-12282: A race condition between export data source // master promotion and getting acks from the previous // failed master can occur. The failed master could have // sent out an ack with Long.MIN and fails immediately after // that, which causes a new master to be elected. The // election and the receiving of this ack message happens on // two different threads on the new master. If it's promoted // while processing the ack, the ack may call `m_onDrain` // while the other thread is polling buffers, which may // never get discarded. // // Now that we are on the same thread, check to see if we // are already promoted to be the master. If so, ignore the // ack. if ( ! m_es . isShutdown ( ) && ! m_mastershipAccepted . get ( ) ) { setCommittedSeqNo ( seq ) ; ackImpl ( seq ) ; } } catch ( Exception e ) { exportLog . error ( "Error acking export buffer" , e ) ; } catch ( Error e ) { VoltDB . crashLocalVoltDB ( "Error acking export buffer" , true , e ) ; } } } ) ; }
Entry point for receiving acknowledgments from remote entities .