1. 16 May, 2020 1 commit
  2. 15 May, 2020 18 commits
  3. 14 May, 2020 17 commits
  4. 13 May, 2020 4 commits
    • Alvaro Herrera's avatar
      Dial back -Wimplicit-fallthrough to level 3 · 17cc133f
      Alvaro Herrera authored
      The additional pain from level 4 is excessive for the gain.
      
      Also revert all the source annotation changes to their original
      wordings, to avoid back-patching pain.
      
      Discussion: https://postgr.es/m/31166.1589378554@sss.pgh.pa.us
      17cc133f
    • Tom Lane's avatar
      Improve management of SLRU statistics collection. · 81ca8686
      Tom Lane authored
      Instead of re-identifying which statistics bucket to use for a given
      SLRU on every counter increment, do it once during shmem initialization.
      This saves a fair number of cycles, and there's no real cost because
      we could not have a bucket assignment that varies over time or across
      backends anyway.
      
      Also, get rid of the ill-considered decision to let pgstat.c pry
      directly into SLRU's shared state; it's cleaner just to have slru.c
      pass the stats bucket number.
      
      In consequence of these changes, there's no longer any need to store
      an SLRU's LWLock tranche info in shared memory, so get rid of that,
      making this a net reduction in shmem consumption.  (That partly
      reverts fe702a7b.)
      
      This is basically code review for 28cac71b, so I also cleaned up
      some comments, removed a dangling extern declaration, fixed some
      things that should be static and/or const, etc.
      
      Discussion: https://postgr.es/m/3618.1589313035@sss.pgh.pa.us
      81ca8686
    • Alvaro Herrera's avatar
      Adjust walsender usage of xlogreader, simplify APIs · 850196b6
      Alvaro Herrera authored
      * Have both physical and logical walsender share a 'xlogreader' state
        struct for tracking state.  This replaces the existing globals sendSeg
        and sendCxt.
      
      * Change WALRead not to receive XLogReaderState->seg and ->segcxt as
        separate arguments anymore; just use the ones from 'state'.  This is
        made possible by the above change.
      
      * have the XLogReader segment_open contract require the callbacks to
        install the file descriptor in the state struct themselves instead of
        returning it.  xlogreader was already ignoring any possible failed
        return from the callbacks, relying solely on them never returning.
      
        (This point is not altogether excellent, as it means the callbacks
        have to know more of XLogReaderState; but to really improve on that
        we would have to pass back error info from the callbacks to
        xlogreader.  And the complexity would not be saved but instead just
        transferred to the callers of WALRead, which would have to learn how
        to throw errors from the open_segment callback in addition of, as
        currently, from pg_pread.)
      
      * segment_open no longer receives the 'segcxt' as a separate argument,
        since it's part of the XLogReaderState argument.
      
      Per comments from Kyotaro Horiguchi.
      
      Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
      Discussion: https://postgr.es/m/20200511203336.GA9913@alvherre.pgsql
      850196b6
    • Fujii Masao's avatar
      Use proper GetDatum function in pg_stat_get_slru(). · 043e3e04
      Fujii Masao authored
      This commit changes pg_stat_get_slru() so that it uses
      TimestampTzGetDatum() for stats_reset field because that field
      stores the timestamp with time zone value. Previously
      Int64GetDatum() was used.
      
      Author: Fujii Masao
      Reviewed-by: Tomas Vondra
      Discussion: https://postgr.es/m/b8784fe6-1401-ab35-aa14-d57b5bb8e312@oss.nttdata.com
      043e3e04