Skip to content
Snippets Groups Projects
Select Git revision
  • benchmark-tools
  • postgres-lambda
  • master default
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
23 results

freespace.c

Blame
    • Tom Lane's avatar
      073ffefd
      Fix inadequate buffer locking in FSM and VM page re-initialization. · 073ffefd
      Tom Lane authored
      When reading an existing FSM or VM page that was found to be corrupt by the
      buffer manager, the code applied PageInit() to reinitialize the page, but
      did so without any locking.  There is thus a hazard that two backends might
      concurrently do PageInit, which in itself would still be OK, but the slower
      one might then zero over subsequent data changes applied by the faster one.
      Even that is unlikely to be fatal; but it's not desirable, so add locking
      to prevent it.
      
      This does not add any locking overhead in the normal code path where the
      page is OK.  It's not immediately obvious that that's safe, but I believe
      it is, for reasons explained in the added comments.
      
      Problem noted by R P Asim.  It's been like this for a long time, so
      back-patch to all supported branches.
      
      Discussion: https://postgr.es/m/CANXE4Te4G0TGq6cr0-TvwP0H4BNiK_-hB5gHe8mF+nz0mcYfMQ@mail.gmail.com
      073ffefd
      History
      Fix inadequate buffer locking in FSM and VM page re-initialization.
      Tom Lane authored
      When reading an existing FSM or VM page that was found to be corrupt by the
      buffer manager, the code applied PageInit() to reinitialize the page, but
      did so without any locking.  There is thus a hazard that two backends might
      concurrently do PageInit, which in itself would still be OK, but the slower
      one might then zero over subsequent data changes applied by the faster one.
      Even that is unlikely to be fatal; but it's not desirable, so add locking
      to prevent it.
      
      This does not add any locking overhead in the normal code path where the
      page is OK.  It's not immediately obvious that that's safe, but I believe
      it is, for reasons explained in the added comments.
      
      Problem noted by R P Asim.  It's been like this for a long time, so
      back-patch to all supported branches.
      
      Discussion: https://postgr.es/m/CANXE4Te4G0TGq6cr0-TvwP0H4BNiK_-hB5gHe8mF+nz0mcYfMQ@mail.gmail.com