5878619 Ticket 48118 - At startup, changelog can be erronously rebuilt after a normal shutdown

Authored and Committed by lkrispen 2 years ago
        Ticket 48118 - At startup, changelog can be erronously rebuilt after a normal shutdown
    
        Problem: There are two problems that can lead to inconsistent database and changelog maxruv:
        1] the database ruv is written periodically in th ehouskeeping thread and at shutdown. It
           relies on teh ruv_dirty flag, but due to a race condition this can be reset befor writing
           the ruv
        2] the changelog max ruv is updated whenever an operation is commutted, but in case of internal
           operations inside the txn for a client operation, if the operation is aborted the cl maxruv
           is not reset. Since it is only written at shutdown this normally is no problem, but if the
           aborted operation is the last before shutdown or is aborted by shutdown the cl ruv is incorrect
    
        Fix: the fix is in two parts:
        1] remove the use of the dirty flag, ensure that the ruv is always written. The overhead for writing
           a database ruv that has not changed is minimal
        2] when writing the changelog maxruv check if the macsns it contains are really present in the
           changelog. If not the maxruv is not written, it will be reconstructed at the next startup
    
        Reviewed by: William,Thierry - Thanks