1. 18 Nov, 2020 3 commits
  2. 17 Nov, 2020 5 commits
    • Peter Geoghegan's avatar
      Deprecate nbtree's BTP_HAS_GARBAGE flag. · cf2acaf4
      Peter Geoghegan authored
      Streamline handling of the various strategies that we have to avoid a
      page split in nbtinsert.c.  When it looks like a leaf page is about to
      overflow, we now perform deleting LP_DEAD items and deduplication in one
      central place.  This greatly simplifies _bt_findinsertloc().
      
      This has an independently useful consequence: nbtree no longer relies on
      the BTP_HAS_GARBAGE page level flag/hint for anything important.  We
      still set and unset the flag in the same way as before, but it's no
      longer treated as a gating condition when considering if we should check
      for already-set LP_DEAD bits.  This happens at the point where the page
      looks like it might have to be split anyway, so simply checking the
      LP_DEAD bits in passing is practically free.  This avoids missing
      LP_DEAD bits just because the page-level hint is unset, which is
      probably reasonably common (e.g. it happens when VACUUM unsets the
      page-level flag without actually removing index tuples whose LP_DEAD-bit
      was set recently, after the VACUUM operation began but before it reached
      the leaf page in question).
      
      Note that this isn't a big behavioral change compared to PostgreSQL 13.
      We were already checking for set LP_DEAD bits regardless of whether the
      BTP_HAS_GARBAGE page level flag was set before we considered doing a
      deduplication pass.  This commit only goes slightly further by doing the
      same check for all indexes, even indexes where deduplication won't be
      performed.
      
      We don't completely remove the BTP_HAS_GARBAGE flag.  We still rely on
      it as a gating condition with pg_upgrade'd indexes from before B-tree
      version 4/PostgreSQL 12.  That makes sense because we sometimes have to
      make a choice among pages full of duplicates when inserting a tuple with
      pre version 4 indexes.  It probably still pays to avoid accessing the
      line pointer array of a page there, since it won't yet be clear whether
      we'll insert on to the page in question at all, let alone split it as a
      result.
      
      Author: Peter Geoghegan <pg@bowt.ie>
      Reviewed-By: default avatarVictor Yegorov <vyegorov@gmail.com>
      Discussion: https://postgr.es/m/CAH2-Wz%3DYpc1PDdk8OVJDChGJBjT06%3DA0Mbv9HyTLCsOknGcUFg%40mail.gmail.com
      cf2acaf4
    • Alvaro Herrera's avatar
      indexcmds.c: reorder function prototypes · 7684b6fb
      Alvaro Herrera authored
      ... out of an overabundance of neatnikism, perhaps.
      7684b6fb
    • Peter Geoghegan's avatar
      nbtree: Rename nbtinsert.c variables for consistency. · a034f8b6
      Peter Geoghegan authored
      Stop naming special area/opaque pointer variables 'lpageop' in contexts
      where it doesn't make sense.  This is a holdover from a time when logic
      that performs tasks that are now spread across _bt_insertonpg(),
      _bt_findinsertloc(), and _bt_split() was more centralized.  'lpageop'
      denotes "left page", which doesn't make sense outside of contexts in
      which there isn't also a right page.
      
      Also acquire page flag variables up front within _bt_insertonpg().  This
      makes it closer to _bt_split() following refactoring commit bc3087b6.
      This allows the page split and retail insert paths to both make use of
      the same variables.
      a034f8b6
    • Amit Kapila's avatar
      Fix 'skip-empty-xacts' option in test_decoding for streaming mode. · 9653f24a
      Amit Kapila authored
      In streaming mode, the transaction can be decoded in multiple streams and
      those streams can be interleaved with streams of other transactions. So,
      we can't remember the transaction's write status in the logical decoding
      context because that might get changed due to some other transactions and
      lead to wrong answers for 'skip-empty-xacts' option. We decided to keep
      each transaction's write status in the ReorderBufferTxn to avoid
      interleaved streams changing the status of some unrelated transactions.
      
      Diagnosed-by: Amit Kapila
      Author: Dilip Kumar
      Reviewed-by: Amit Kapila
      Discussion: https://postgr.es/m/CAA4eK1LR7=XNM_TLmpZMFuV8ZQpoxkem--NZJYf8YXmesbvwLA@mail.gmail.com
      9653f24a
    • Tom Lane's avatar
      Don't Insert() a VFD entry until it's fully built. · 2bd49b49
      Tom Lane authored
      Otherwise, if FDDEBUG is enabled, the debugging output fails because
      it tries to read the fileName, which isn't set up yet (and should in
      fact always be NULL).
      
      AFAICT, this has been wrong since Berkeley.  Before 96bf88d5,
      it would accidentally fail to crash on platforms where snprintf()
      is forgiving about being passed a NULL pointer for %s; but the
      file name intended to be included in the debug output wouldn't
      ever have shown up.
      
      Report and fix by Greg Nancarrow.  Although this is only visibly
      broken in custom-made builds, it still seems worth back-patching
      to all supported branches, as the FDDEBUG code is pretty useless
      as it stands.
      
      Discussion: https://postgr.es/m/CAJcOf-cUDgm9qYtC_B6XrC6MktMPNRby2p61EtSGZKnfotMArw@mail.gmail.com
      2bd49b49
  3. 16 Nov, 2020 13 commits
  4. 15 Nov, 2020 7 commits
  5. 14 Nov, 2020 3 commits
  6. 13 Nov, 2020 2 commits
  7. 12 Nov, 2020 7 commits