1. 09 Dec, 2019 1 commit
    • Tom Lane's avatar
      Improve isolationtester's timeout management. · 99351a8b
      Tom Lane authored
      isolationtester.c had a hard-wired limit of 3 minutes per test step.
      It now emerges that this isn't quite enough for some of the slowest
      buildfarm animals.  This isn't the first time we've had to raise
      this limit (cf. 1db439ad), so let's make it configurable.  This
      patch raises the default to 5 minutes, and introduces an environment
      variable PGISOLATIONTIMEOUT that can be set if more time is needed,
      following the precedent of PGCTLTIMEOUT.
      
      Also, modify isolationtester so that when the timeout is hit,
      it explicitly reports having sent a cancel.  This makes the regression
      failure log considerably more intelligible.  (In the worst case, a
      timed-out test might actually be reported as "passing" without this
      extra output, so arguably this is a bug fix in itself.)
      
      In passing, update the README file, which had apparently not gotten
      touched when we added "make check" support here.
      
      Back-patch to 9.6; older versions don't have comparable timeout logic.
      
      Discussion: https://postgr.es/m/22964.1575842935@sss.pgh.pa.us
      99351a8b
  2. 11 Dec, 2018 1 commit
  3. 11 Feb, 2016 1 commit
  4. 12 Feb, 2014 1 commit
  5. 05 Sep, 2012 1 commit
  6. 08 Aug, 2012 1 commit
  7. 28 Jan, 2012 1 commit
    • Tom Lane's avatar
      Add simple tests of EvalPlanQual using the isolationtester infrastructure. · 759d9d67
      Tom Lane authored
      Much more could be done here, but at least now we have *some* automated
      test coverage of that mechanism.  In particular this tests the writable-CTE
      case reported by Phil Sorber.
      
      In passing, remove isolationtester's arbitrary restriction on the number of
      steps in a permutation list.  I used this so that a single spec file could
      be used to run several related test scenarios, but there are other possible
      reasons to want a step series that's not exactly a permutation.  Improve
      documentation and fix a couple other nits as well.
      759d9d67
  8. 18 Aug, 2011 1 commit
  9. 12 Jul, 2011 1 commit
    • Alvaro Herrera's avatar
      Add support for blocked commands in isolationtester · 846af54d
      Alvaro Herrera authored
      This enables us to test that blocking commands (such as foreign keys
      checks that conflict with some other lock) act as intended.  The set of
      tests that this adds is pretty minimal, but can easily be extended by
      adding new specs.
      
      The intention is that this will serve as a basis for ensuring that
      further tweaks of locking implementation preserve (or improve) existing
      behavior.
      
      Author: Noah Misch
      846af54d
  10. 24 May, 2011 1 commit
  11. 10 Feb, 2011 1 commit
  12. 07 Feb, 2011 1 commit
    • Heikki Linnakangas's avatar
      Implement genuine serializable isolation level. · dafaa3ef
      Heikki Linnakangas authored
      Until now, our Serializable mode has in fact been what's called Snapshot
      Isolation, which allows some anomalies that could not occur in any
      serialized ordering of the transactions. This patch fixes that using a
      method called Serializable Snapshot Isolation, based on research papers by
      Michael J. Cahill (see README-SSI for full references). In Serializable
      Snapshot Isolation, transactions run like they do in Snapshot Isolation,
      but a predicate lock manager observes the reads and writes performed and
      aborts transactions if it detects that an anomaly might occur. This method
      produces some false positives, ie. it sometimes aborts transactions even
      though there is no anomaly.
      
      To track reads we implement predicate locking, see storage/lmgr/predicate.c.
      Whenever a tuple is read, a predicate lock is acquired on the tuple. Shared
      memory is finite, so when a transaction takes many tuple-level locks on a
      page, the locks are promoted to a single page-level lock, and further to a
      single relation level lock if necessary. To lock key values with no matching
      tuple, a sequential scan always takes a relation-level lock, and an index
      scan acquires a page-level lock that covers the search key, whether or not
      there are any matching keys at the moment.
      
      A predicate lock doesn't conflict with any regular locks or with another
      predicate locks in the normal sense. They're only used by the predicate lock
      manager to detect the danger of anomalies. Only serializable transactions
      participate in predicate locking, so there should be no extra overhead for
      for other transactions.
      
      Predicate locks can't be released at commit, but must be remembered until
      all the transactions that overlapped with it have completed. That means that
      we need to remember an unbounded amount of predicate locks, so we apply a
      lossy but conservative method of tracking locks for committed transactions.
      If we run short of shared memory, we overflow to a new "pg_serial" SLRU
      pool.
      
      We don't currently allow Serializable transactions in Hot Standby mode.
      That would be hard, because even read-only transactions can cause anomalies
      that wouldn't otherwise occur.
      
      Serializable isolation mode now means the new fully serializable level.
      Repeatable Read gives you the old Snapshot Isolation level that we have
      always had.
      
      Kevin Grittner and Dan Ports, reviewed by Jeff Davis, Heikki Linnakangas and
      Anssi Kääriäinen
      dafaa3ef