1. 13 1月, 2018 2 次提交
    • H
      Also remove references to enable_segwalrep in Makefiles. · 1697a640
      Heikki Linnakangas 提交于
      I removed the autoconf flag and #ifdefs earlier, but missed these.
      1697a640
    • H
      Remove a lot of persistent table and mirroring stuff. · 5c158ff3
      Heikki Linnakangas 提交于
      * Revert almost all the changes in smgr.c / md.c, to not go through
        the Mirrored* APIs.
      
      * Remove mmxlog stuff. Use upstream "pending relation deletion" code
        instead.
      
      * Get rid of multiple startup passes. Now it's just a single pass like
        in the upstream.
      
      * Revert the way database drop/create are handled to the way it is in
        upstream. Doesn't use PT anymore, but accesses file system directly,
        and WAL-logs a single CREATE/DROP DATABASE WAL record.
      
      * Get rid of MirroredLock
      
      * Remove a few tests that were specific to persistent tables.
      
      * Plus a lot of little removals and reverts to upstream code.
      5c158ff3
  2. 30 11月, 2017 1 次提交
    • J
      Restrain replay of MMXLOG and smgr xlog records · 08f4e145
      Jimmy Yih 提交于
      MMXLOG records should only be replayed in standby mode and smgr create
      xlog records should not do anything until persistent tables and MMXLOG
      records are removed from Greenplum.
      
      Author: Jimmy Yih <jyih@pivotal.io>
      Author: Asim Praveen <apraveen@pivotal.io>
      08f4e145
  3. 11 11月, 2017 1 次提交
    • J
      Add unit tests for append-optimized usage of invalid_page_tab hash table · 74d07939
      Jimmy Yih 提交于
      cdbappendonlystorage_test.c:
      Test that calling appendonly_redo with XLOG_APPENDONLY_INSERT or
      XLOG_APPENDONLY_TRUNCATE will call ao_insert_replay or
      ao_truncate_replay respectively.
      
      xlog_mm_test.c:
      Test that an MMXLOG_REMOVE_FILE AO transaction log record will call
      XLogAODropSegmentFile.
      
      cdbmirroredappendonly_test.c:
      Test that ao_insert_replay or ao_truncate_replay will call
      XLogAOSegmentFile when we cannot find the AO segment file.
      
      xlogutils_test.c:
      Test that the invalid_page_tab hash table is properly used when
      invalid AO segment files are encountered.
      
      These four pieces combined will test the case when AO XLOG records are
      replayed but the corresponding segment files are missing from
      filesystem. The replay is entered into the invalid_page_tab hash table
      until a corresponding MMXLOG_REMOVE_FILE XLOG record type comes along
      to remove the entry.
      
      Currently these unit tests are under --enable-segwalrep configure flag
      in the Makefile but can be moved to the actual TARGET if non-segwalrep
      tests are added and need to be tested.
      
      Reference:
      https://github.com/greenplum-db/gpdb/commit/b659d0479fa57c383e7dbe15043cd2ca9d46f77f
      74d07939
  4. 25 8月, 2017 1 次提交
    • H
      Use ereport, rather than elog, for performance. · 01dff3ba
      Heikki Linnakangas 提交于
      ereport() has one subtle but important difference to elog: it doesn't
      evaluate its arguments, if the log level says that the message doesn't
      need to be printed. This makes a small but measurable difference in
      performance, if the arguments contain more complicated expressions, like
      function calls.
      
      While performance testing a workload with very short queries, I saw some
      CPU time being used in DtxContextToString. Those calls were coming from the
      arguments to elog() statements, and the result was always thrown away,
      because the log level was not high enough to actually log anything. Turn
      those elog()s into ereport()s, for speed.
      
      The problematic case here was a few elogs containing DtxContextToString
      calls, in hot codepaths, but I changed a few surrounding ones too, for
      consistency.
      
      Simplify the mock test, to not bother mocking elog(), while we're at it.
      The real elog/ereport work just fine in the mock environment.
      01dff3ba
  5. 19 8月, 2017 1 次提交
  6. 02 6月, 2017 1 次提交
    • X
      Remove subtransaction information from SharedLocalSnapshotSlot · b52ca70f
      Xin Zhang 提交于
      Originally, the reader kept copies of subtransaction information in
      two places.  First, it copied SharedLocalSnapshotSlot to share between
      writer and reader.  Second, reader kept another copy in subxbuf for
      better performance.  Due to lazy xid, subtransaction information can
      change in the writer asynchronously with respect to the reader.  This
      caused reader's subtransaction information out of date.
      
      This fix removes those copies of subtransaction information in the
      reader and adds a reference to the writer's PGPROC to
      SharedLocalSnapshotSlot.  Reader should refer to subtransaction
      information through writer's PGPROC and pg_subtrans.
      
      Also added is a lwlock per shared snapshot slot.  The lock protects
      shared snapshot information between a writer and readers belonging to
      the same session.
      
      Fixes github issues #2269 and #2284.
      Signed-off-by: NAsim R P <apraveen@pivotal.io>
      b52ca70f
  7. 09 12月, 2015 4 次提交
    • H
      Refactor mock test Makefiles to only mock backend files as needed. · fbe20ae7
      Heikki Linnakangas 提交于
      Instead of creating a mock version of every backend object file, only
      create mock files as needed by individual tests. Speeds up the build, and
      is nicer anyway.
      fbe20ae7
    • H
      In mock tests, link real version of every backend object file by default. · 8748fe5f
      Heikki Linnakangas 提交于
      This inverts the logic of the <testname>_REAL_OBJS mechanism. We now link
      with the real version of each object file, *except* those listed in
      <testname>_MOCK_OBJS variable.
      8748fe5f
    • H
      Simplify mock test Makefiles. · 0e27dff3
      Heikki Linnakangas 提交于
      There are a bunch of backend files that are never mocked, but always linked
      into test program as is. List those in Makefile.mock, so that every Makefile
      doesn't need to list them. Makes the makefiles simpler, and you need less
      boilerplate code when adding a new test program.
      
      Not all of these backend files were listed in the _REAL_OBJS variable of
      every test, but in those tests that they were not, they were also not used,
      so it doesn't matter if we use the real or mock version.
      0e27dff3
    • H
      Divide backend-specific mock stuff to separate Makefile. · ee17fd1d
      Heikki Linnakangas 提交于
      This way we don't need to link the whole backend into client mock programs.
      We've gotten away with it so far, but it would cause clashes if one of the
      client programs contained a function or global variable with same name as
      in the backend. And of course it's completely unnecessary anyway.
      ee17fd1d
  8. 16 11月, 2015 1 次提交
    • H
      Move GPDB-specific GUCs to separate file. · 69af7ce7
      Heikki Linnakangas 提交于
      This makes merging and diffing with upstream easier. There were so many
      GPDB-added GUCs in guc.c that "git merge" didn't handle it very well, and
      you easily got merge conflicts that were error-prone to fix manually.
      
      I kept a few GUCs in guc.c that are not present in REL8_2_0, because they
      were backported from later PostgreSQL versions, rather than being
      completely GPDB-specific.
      
      Clean up the diff between guc.c and upstream, by removing unnecessary
      includes, reordering a few GUCs to match upstream better, and similar
      cosmetic changes.
      
      I had to move MAX_KILOBYTES from guc.c to guc_tables.h, because guc_gp.c
      needs it too. I also had to export assign_msglvl() function from guc.c, so
      that it can be called from other assign_* functions from guc_gp.c. And I
      had to add the code to process the ConfigureNames*_gp arrays in addition
      to the upstream ones. These things increase the diff against upstream, but
      not by too much, IMHO. I also copy-pasted constants like MS_PER_S and
      KB_PER_MB, which seems safe as those are natural constants, and should
      never change.
      69af7ce7
  9. 07 11月, 2015 1 次提交
    • H
      Don't link strlcpy.o into mock test programs. · 6125d802
      Heikki Linnakangas 提交于
      Now that we no longer forcibly compile strlcpy.c, and only compile and link
      it into strlcpy.o into libpgport when needed, this is no longer needed.
      Furthermore, it caused the linking to fail on platforms that don't need
      strlcpy.o, like OS X.
      6125d802
  10. 28 10月, 2015 1 次提交