1. 05 8月, 2017 8 次提交
    • S
      Compiler optimizations for page checksum code. · 418cc70c
      Simon Riggs 提交于
      Ants Aasma and Jeff Davis
      
      (cherry picked from commit fdea2530)
      418cc70c
    • S
      Introduce new page checksum algorithm and module. · 3fe41fe1
      Simon Riggs 提交于
      Isolate checksum calculation to its own module, so that bufpage
      knows little if anything about the details of the calculation.
      
      This implementation is a modified FNV-1a hash checksum, details
      of which are given in the new checksum.c header comments.
      
      Basic implementation only, so we fix the output value.
      
      Later related commits will add version numbers to pg_control,
      compiler optimization flags and memory barriers.
      
      Ants Aasma, reviewed by Jeff Davis and Simon Riggs
      
      (cherry picked from commit 43e7a668)
      3fe41fe1
    • S
      Skip extraneous locking in XLogCheckBuffer(). · 42ec21e1
      Simon Riggs 提交于
      Heikki reported comment was wrong, so fixed
      code to match the comment: we only need to
      take additional locking precautions when we
      have a shared lock on the buffer.
      
      (cherry picked from commit 5787c673)
      42ec21e1
    • S
      Avoid tricky race condition recording XLOG_HINT · 141479d4
      Simon Riggs 提交于
      We copy the buffer before inserting an XLOG_HINT to avoid WAL CRC errors
      caused by concurrent hint writes to buffer while share locked. To make this work
      we refactor RestoreBackupBlock() to allow an XLOG_HINT to avoid the normal
      path for backup blocks, which assumes the underlying buffer is exclusive locked.
      Resulting code completely changes layout of XLOG_HINT WAL records, but
      this isn't even beta code, so this is a low impact change.
      In passing, avoid taking WALInsertLock for full page writes on checksummed
      hints, remove related cruft from XLogInsert() and improve xlog_desc record for
      XLOG_HINT.
      
      Andres Freund
      
      Bug report by Fujii Masao, testing by Jeff Janes and Jaime Casanova,
      review by Jeff Davis and Simon Riggs. Applied with changes from review
      and some comment editing.
      
      (cherry picked from commit 47c43331)
      141479d4
    • S
      README comments on checksums on page holes. · d51a0789
      Simon Riggs 提交于
      (cherry picked from commit a4b94b85)
      d51a0789
    • S
      Tune BufferGetLSNAtomic() when checksums !enabled · 0d80b5d6
      Simon Riggs 提交于
      From performance analysis by Heikki Linnakangas
      
      (cherry picked from commit 1be20351)
      0d80b5d6
    • A
      Fix the race condition of checkpoint with backup block · 1c9fa6ff
      Ashwin Agrawal 提交于
      Also exclude the block backup for temp relations
      Signed-off-by: NXin Zhang <xzhang@pivotal.io>
      1c9fa6ff
    • A
      Testing for full page image after hint bit change. · 6c7ab982
      Ashwin Agrawal 提交于
      With `gp_disable_tuple_hints` off, buffer will be marked dirty for hint
      bit changes. The XLOG should capture the full page image if the hint bit
      is the first change after checkpoint.
      
      During recovery, the full page image should be replayed to override the
      page, even if the page is corrupted on disk.
      
      This test verified the table with corrupted page full fixed after
      recovery if the `gp_disable_tuple_hints` off.
      Signed-off-by: NXin Zhang <xzhang@pivotal.io>
      6c7ab982
  2. 04 8月, 2017 8 次提交
  3. 03 8月, 2017 15 次提交
    • N
      Fix resource group memory overuse issue when increasing concurrency. · 94a08704
      Ning Yu 提交于
      Resource group may have memory overuse in below case:
      
      	CREATE RESOURCE GROUP rg_concurrency_test WITH
      	(concurrency=1, cpu_rate_limit=20, memory_limit=60,
      	 memory_shared_quota=0, memory_spill_ratio=10);
      	CREATE ROLE role_concurrency_test RESOURCE GROUP rg_concurrency_test;
      
      	11:SET ROLE role_concurrency_test;
      	11:BEGIN;
      
      	21:SET ROLE role_concurrency_test;
      	22:SET ROLE role_concurrency_test;
      	21&:BEGIN;
      	22&:BEGIN;
      
      	ALTER RESOURCE GROUP rg_concurrency_test SET CONCURRENCY 2;
      
      	11:END;
      
      The cause is that we didn't check overall memory quota usage in the
      past, so pending queries can be waken up as long as the concurrency
      limit is not reached, in such a case if the currently running tranctions
      have used all the memory quota in the resource group then the overall
      memory usage will be exceeded.
      
      To fix this issue we now checks both concurrency limit and memory quota
      usage to decide whether to wake up pending queries.
      Signed-off-by: NZhenghua Lyu <zlv@pivotal.io>
      94a08704
    • H
      759c19d0
    • M
      Fixed 'COPY table FROM file ON SEGMENT' bug: multiple blocks file only read the first block (#2869) · 29bf1d53
      Ming LI 提交于
      This bug is caused by:
      For COPY FROM ON SEGMENT, on QE, process the data stream (empty) dispatched from QD at first, then re-do the same workflow to read and process the local segment data file. Before redo, all flags need to be reset to initial values too. However we missed one flag.
      29bf1d53
    • X
      Mask out checksum in gpcheckmirrorseg.pl · 634858cd
      Xin Zhang 提交于
      Add the checksum masking and clearly separate where that masking is applied
      separately from when the lp array masking is applied.
      
      This will ensure the data in buf only updated once.
      Signed-off-by: NC.J. Jameson <cjameson@pivotal.io>
      634858cd
    • X
      Add checksum verification on mirror of filerep resync · 51ff21af
      Xin Zhang 提交于
      Validate every BufferPool page sent to the mirror by the
      primary prior to writing.
      Signed-off-by: NTaylor Vesely <tvesely@pivotal.io>
      51ff21af
    • T
      Fix filerep checksum bug. · e24eff92
      Taylor Vesely 提交于
      During resync, filerep copied block with out-of-date checksum over from primary
      to mirror. This caused checksum verification failure later on the mirror side,
      and also caused inconsistency between the two on disk images of primary and
      mirror.
      
      The fix introduced here will always recompute the checksum during resync.
      
      The performance impact is very low, since we only recompute the checksum for
      changed blocks. However, for the full copy, we will recompute checksum for all
      the blocks to be copied. We have to do it, because there is no easy way to
      gurantee there no other changes like hint bit change during resync, since it's
      an online operation.
      
      Also fixed wrong comments regarding to page lsn.
      Signed-off-by: NXin Zhang <xzhang@pivotal.io>
      e24eff92
    • S
      Fix checksums for CLUSTER, VACUUM FULL etc. · 058527bc
      Simon Riggs 提交于
      In CLUSTER, VACUUM FULL and ALTER TABLE SET TABLESPACE
      I erroneously set checksum before log_newpage, which
      sets the LSN and invalidates the checksum. So set
      checksum immediately *after* log_newpage.
      
      Bug report Fujii Masao, Fix and patch by Jeff Davis
      
      (cherry picked from commit cf8dc9e1)
      058527bc
    • T
      Suppress uninitialized-variable warning in new checksum code. · cbb4795e
      Tom Lane 提交于
      Some compilers understand that this coding is safe, and some don't.
      
      (cherry picked from commit 4912385b)
      Signed-off-by: NTaylor Vesely <tvesely@pivotal.io>
      cbb4795e
    • S
      Add new README file for pages/checksums · 696816bb
      Simon Riggs 提交于
      (cherry picked from commit 9df56f6d)
      696816bb
    • A
      Bug Fix of checksum for `create database` · 44ea018d
      Asim R P 提交于
      Signed-off-by: NXin Zhang <xzhang@pivotal.io>
      44ea018d
    • A
      Add test for heap checksums · da3178dd
      Abhijit Subramanya 提交于
      This test is based on ao_checksum_corruption.sql.
      
      We added new UDF `invalidate_buffers()` to invalidate buffers for given
      relation, so that we can read the content from the corrupted file again.
      
      We tested corruptions on heap table, toast table, btree and bitmap indexes.
      Signed-off-by: NXin Zhang <xzhang@pivotal.io>
      da3178dd
    • N
      Adding HEAP_CHECKSUM to gpinitsystem · ee53d9ab
      Nadeem Ghani 提交于
      This is a new config option, on by default.
      Signed-off-by: NMarbin Tan <mtan@pivotal.io>
      ee53d9ab
    • S
      Allow I/O reliability checks using 16-bit checksums · ed0efd2a
      Simon Riggs 提交于
      Checksums are set immediately prior to flush out of shared buffers
      and checked when pages are read in again. Hint bit setting will
      require full page write when block is dirtied, which causes various
      infrastructure changes. Extensive comments, docs and README.
      
      WARNING message thrown if checksum fails on non-all zeroes page;
      ERROR thrown but can be disabled with ignore_checksum_failure = on.
      
      Feature enabled by an initdb option, since transition from option off
      to option on is long and complex and has not yet been implemented.
      Default is not to use checksums.
      
      Checksum used is WAL CRC-32 truncated to 16-bits.
      
      Simon Riggs, Jeff Davis, Greg Smith
      Wide input and assistance from many community members. Thank you.
      
      (cherry picked from commit 96ef3b8f)
      ed0efd2a
    • S
      Remove PageSetTLI and rename pd_tli to pd_checksum · 626df6b4
      Simon Riggs 提交于
      Remove use of PageSetTLI() from all page manipulation functions
      and adjust README to indicate change in the way we make changes
      to pages. Repurpose those bytes into the pd_checksum field and
      explain how that works in comments about page header.
      
      Refactoring ahead of actual feature patch which would make use
      of the checksum field, arriving later.
      
      Jeff Davis, with comments and doc changes by Simon Riggs
      Direction suggested by Robert Haas; many others providing
      review comments.
      
      (cherry picked from bb7cc262)
      626df6b4
    • B
      Fix memory leak while print missing column stats · 71752344
      Bhuvnesh Chaudhary 提交于
      Relation metadata reference was added twice due to which
      memory leak is detected and PQO fallsback to planner. This patch
      removes redundant AddRef for Relation Metadata and fixes fallback.
      Signed-off-by: NEkta Khanna <ekhanna@pivotal.io>
      71752344
  4. 02 8月, 2017 9 次提交