Thread

  1. PoC: Simplify recovery after dropping a table by LOGGING the restore LSN

    Kirk Wolak <wolakk@gmail.com> — 2024-11-08T03:46:54Z

    Hackers,
      The concept was driven by an all too common support request.  A user
    accidentally dropped the wrong table.  (this could also be applied to
    dropping a database, etc).
    
      If we had the LSN before the drop, this would be easier.  So we actually
    log the LSN when the lock is required so that we have an accurate LSN and
    the recovery is much simpler.
    
      All we are doing is inserting a simple LOG message:
    Acquired drop table lock on table <relname>. Restore at <LSN>
    
      This is a rough patch, very simple and effective.  We are looking for
    feedback.
    
      Comments are appreciated!
    
      Should we ALSO consider this for:
         - DROP DATABASE
         - TRUNCATE TABLE
         - DELETE (only when it is without a WHERE clause?)
         - UPDATE (only when it is without a WHERE clause?)
    
    Regards
    
    Andrey, Nikolay, Kirk