1. 06 5月, 2016 1 次提交
  2. 19 3月, 2016 2 次提交
    • A
      Validate pg_class pg_type tuple after index fetch. · 0ff952e7
      Ashwin Agrawal 提交于
      While fetching the pg_class or pg_type tuple using index, perform sanity
      check to make sure tuple intended to read, is the tuple index is
      pointing too. This is just sanity check to make sure index is not broken
      and not returning some incorrect tuple to contain the damage.
      0ff952e7
    • A
      Validate gp_relation_node tuple after index fetch. · c8a21e0d
      Ashwin Agrawal 提交于
      This commit makes sure while accessing gp_relation_node through its
      index, sanity check is always performed to verify the tuple being
      operated on is the intended tuple, else for any reason index is broken
      and provide bad tuple fail the operation instead of causing damage.
      For some scenarios like delete gp_relation_code tuple case it adds extra tuple
      deform call which was not done earlier but doesn't seem heavy enough to
      be performed on ddl operation.
      c8a21e0d
  3. 12 2月, 2016 1 次提交
    • H
      Remove unnecessary #includes. · 9aa7a22f
      Heikki Linnakangas 提交于
      In cdbcat.h, include only the header files that are actually needed for
      the single function prototype in that file. And don't include cdbcat.h
      unnecessarily. A couple of .c files were including cdbcat.h to get
      GpPolicy, but that's actually defined in catalog/gp_policy.h, so #include
      that directly instead where needed.
      9aa7a22f
  4. 12 1月, 2016 1 次提交
    • H
      Make functions in gp_toolkit to execute on all nodes as intended. · 246f7510
      Heikki Linnakangas 提交于
      Moving the installation of gp_toolkit.sql into initdb, in commit f8910c3c,
      broke all the functions that are supposed to execute on all nodes, like
      gp_toolkit.__gp_localid. After that change, gp_toolkit.sql was executed
      in utility mode, and the gp_distribution_policy entries for those functions
      were not created as a result.
      
      To fix, change the code so that gp_distribution_policy entries are never
      never created, or consulted, for EXECUTE-type external tables. They have
      more fine-grained information in pg_exttable.location field anyway, so rely
      on that instead. With this change, there is no difference in whether an
      EXECUTE-type external table is created in utility mode or not. We would
      still have similar problems if gp_toolkit contained other kinds of
      external tables, but it doesn't.
      
      This removes the isMasterOnly() function and changes all its callers to
      call GpPolicyFetch() directly instead. Some places used GpPolicyFetch()
      directly to check if a table is distributed, so this just makes that the
      canonical way to do it. The check for system schemas that used to be in
      isMasterOnly() are no longer performed, but they should've unnecessary in
      the first place. System tables don't have gp_distribution_policy entries,
      so they'll be treated as master-only even without that check.
      246f7510
  5. 19 11月, 2015 1 次提交
    • H
      Remove gp_upgrade_mode and related machinery. · d9b60cd2
      Heikki Linnakangas 提交于
      The current plan is to use something like pg_upgrade for future in-place
      upgrades. The gpupgrade mechanism will not scale to the kind of drastic
      catalog and other data directory layout changes that are coming as we
      merge with later PostgreSQL releases.
      
      Kept gpupgrademirror for now. Need to check if there's some logic that's
      worth saving, for a possible pg_upgrade based solution later.
      d9b60cd2
  6. 28 10月, 2015 1 次提交
  7. 25 1月, 2007 1 次提交
  8. 09 1月, 2007 1 次提交
    • T
      Support ORDER BY ... NULLS FIRST/LAST, and add ASC/DESC/NULLS FIRST/NULLS LAST · 44317582
      Tom Lane 提交于
      per-column options for btree indexes.  The planner's support for this is still
      pretty rudimentary; it does not yet know how to plan mergejoins with
      nondefault ordering options.  The documentation is pretty rudimentary, too.
      I'll work on improving that stuff later.
      
      Note incompatible change from prior behavior: ORDER BY ... USING will now be
      rejected if the operator is not a less-than or greater-than member of some
      btree opclass.  This prevents less-than-sane behavior if an operator that
      doesn't actually define a proper sort ordering is selected.
      44317582
  9. 06 1月, 2007 1 次提交
  10. 01 1月, 2007 1 次提交
    • T
      Found the problem with my operator-family changes: by fetching from · 0b56be83
      Tom Lane 提交于
      pg_opclass during LookupOpclassInfo(), I'd turned pg_opclass_oid_index
      into a critical system index.  However the problem could only manifest
      during a backend's first attempt to load opclass data, and then only
      if it had successfully loaded pg_internal.init and subsequently received
      a relcache flush; which made it impossible to reproduce in sequential
      tests and darn hard even in parallel tests.  Memo to self: when
      exercising cache flush scenarios, must disable LookupOpclassInfo's
      internal cache too.
      0b56be83
  11. 23 12月, 2006 1 次提交
    • T
      Restructure operator classes to allow improved handling of cross-data-type · a78fcfb5
      Tom Lane 提交于
      cases.  Operator classes now exist within "operator families".  While most
      families are equivalent to a single class, related classes can be grouped
      into one family to represent the fact that they are semantically compatible.
      Cross-type operators are now naturally adjunct parts of a family, without
      having to wedge them into a particular opclass as we had done originally.
      
      This commit restructures the catalogs and cleans up enough of the fallout so
      that everything still works at least as well as before, but most of the work
      needed to actually improve the planner's behavior will come later.  Also,
      there are not yet CREATE/DROP/ALTER OPERATOR FAMILY commands; the only way
      to create a new family right now is to allow CREATE OPERATOR CLASS to make
      one by default.  I owe some more documentation work, too.  But that can all
      be done in smaller pieces once this infrastructure is in place.
      a78fcfb5
  12. 06 11月, 2006 1 次提交
    • T
      Fix recently-identified PITR recovery hazard: the base backup could contain · 76d5667b
      Tom Lane 提交于
      stale relcache init files (pg_internal.init), and there is no mechanism for
      updating them during WAL replay.  Easiest solution is just to delete the init
      files at conclusion of startup, and let the first backend started in each
      database take care of rebuilding the init file.  Simon Riggs and Tom Lane.
      
      Back-patched to 8.1.  Arguably this should be fixed in 8.0 too, but it would
      require significantly more code since 8.0 has no handy startup-time scan of
      pg_database to piggyback on.  Manual solution of the problem is possible
      in 8.0 (just delete the pg_internal.init files before starting WAL replay),
      so that may be a sufficient answer.
      76d5667b
  13. 04 10月, 2006 1 次提交
  14. 06 9月, 2006 1 次提交
    • T
      Get rid of the separate RULE privilege for tables: now only a table's owner · 7bae5a28
      Tom Lane 提交于
      can create or modify rules for the table.  Do setRuleCheckAsUser() while
      loading rules into the relcache, rather than when defining a rule.  This
      ensures that permission checks for tables referenced in a rule are done with
      respect to the current owner of the rule's table, whereas formerly ALTER TABLE
      OWNER would fail to update the permission checking for associated rules.
      Removal of separate RULE privilege is needed to prevent various scenarios
      in which a grantee of RULE privilege could effectively have any privilege
      of the table owner.  For backwards compatibility, GRANT/REVOKE RULE is still
      accepted, but it doesn't do anything.  Per discussion here:
      http://archives.postgresql.org/pgsql-hackers/2006-04/msg01138.php
      7bae5a28
  15. 01 8月, 2006 1 次提交
    • T
      Change the relation_open protocol so that we obtain lock on a relation · 09d3670d
      Tom Lane 提交于
      (table or index) before trying to open its relcache entry.  This fixes
      race conditions in which someone else commits a change to the relation's
      catalog entries while we are in process of doing relcache load.  Problems
      of that ilk have been reported sporadically for years, but it was not
      really practical to fix until recently --- for instance, the recent
      addition of WAL-log support for in-place updates helped.
      
      Along the way, remove pg_am.amconcurrent: all AMs are now expected to support
      concurrent update.
      09d3670d
  16. 14 7月, 2006 2 次提交
  17. 04 7月, 2006 1 次提交
    • T
      Code review for FILLFACTOR patch. Change WITH grammar as per earlier · b7b78d24
      Tom Lane 提交于
      discussion (including making def_arg allow reserved words), add missed
      opt_definition for UNIQUE case.  Put the reloptions support code in a less
      random place (I chose to make a new file access/common/reloptions.c).
      Eliminate header inclusion creep.  Make the index options functions safely
      user-callable (seems like client apps might like to be able to test validity
      of options before trying to make an index).  Reduce overhead for normal case
      with no options by allowing rd_options to be NULL.  Fix some unmaintainably
      klugy code, including getting rid of Natts_pg_class_fixed at long last.
      Some stylistic cleanup too, and pay attention to keeping comments in sync
      with code.
      
      Documentation still needs work, though I did fix the omissions in
      catalogs.sgml and indexam.sgml.
      b7b78d24
  18. 02 7月, 2006 1 次提交
  19. 17 6月, 2006 1 次提交
    • T
      Fix problems with cached tuple descriptors disappearing while still in use · 06e10abc
      Tom Lane 提交于
      by creating a reference-count mechanism, similar to what we did a long time
      ago for catcache entries.  The back branches have an ugly solution involving
      lots of extra copies, but this way is more efficient.  Reference counting is
      only applied to tupdescs that are actually in caches --- there seems no need
      to use it for tupdescs that are generated in the executor, since they'll go
      away during plan shutdown by virtue of being in the per-query memory context.
      Neil Conway and Tom Lane
      06e10abc
  20. 06 5月, 2006 1 次提交
  21. 05 5月, 2006 1 次提交
  22. 26 4月, 2006 1 次提交
    • T
      Arrange to cache btree metapage data in the relcache entry for the index, · d2896a9e
      Tom Lane 提交于
      thereby saving a visit to the metapage in most index searches/updates.
      This wouldn't actually save any I/O (since in the old regime the metapage
      generally stayed in cache anyway), but it does provide a useful decrease
      in bufmgr traffic in high-contention scenarios.  Per my recent proposal.
      d2896a9e
  23. 05 3月, 2006 1 次提交
  24. 20 1月, 2006 1 次提交
    • T
      Avoid crashing if relcache flush occurs while trying to load data into an · ed69cf5d
      Tom Lane 提交于
      index's support-function cache (in index_getprocinfo).  Since none of that
      data can change for an index that's in active use, it seems sufficient to
      treat all open indexes the same way we were treating "nailed" system indexes
      --- that is, just re-read the pg_class row and leave the rest of the relcache
      entry strictly alone.  The pg_class re-read might not be strictly necessary
      either, but since the reltablespace and relfilenode can change in normal
      operation it seems safest to do it.  (We don't support changing any of the
      other info about an index at all, at the moment.)
      
      Back-patch as far as 8.0.  It might be possible to adapt the patch to 7.4,
      but it would take more work than I care to expend for such a low-probability
      problem.  7.3 is out of luck for sure.
      ed69cf5d
  25. 19 1月, 2006 1 次提交
  26. 09 1月, 2006 1 次提交
  27. 05 1月, 2006 1 次提交
  28. 09 12月, 2005 1 次提交
    • T
      Simplify lock manager data structures by making a clear separation between · c599a247
      Tom Lane 提交于
      the data defining the semantics of a lock method (ie, conflict resolution
      table and ancillary data, which is all constant) and the hash tables
      storing the current state.  The only thing we give up by this is the
      ability to use separate hashtables for different lock methods, but there
      is no need for that anyway.  Put some extra fields into the LockMethod
      definition structs to clean up some other uglinesses, like hard-wired
      tests for DEFAULT_LOCKMETHOD and USER_LOCKMETHOD.  This commit doesn't
      do anything about the performance issues we were discussing, but it clears
      away some of the underbrush that's in the way of fixing that.
      c599a247
  29. 23 11月, 2005 1 次提交
  30. 21 11月, 2005 1 次提交
  31. 15 10月, 2005 1 次提交
  32. 16 9月, 2005 1 次提交
  33. 26 8月, 2005 1 次提交
  34. 12 8月, 2005 1 次提交
    • T
      Solve the problem of OID collisions by probing for duplicate OIDs · 721e5378
      Tom Lane 提交于
      whenever we generate a new OID.  This prevents occasional duplicate-OID
      errors that can otherwise occur once the OID counter has wrapped around.
      Duplicate relfilenode values are also checked for when creating new
      physical files.  Per my recent proposal.
      721e5378
  35. 09 8月, 2005 1 次提交
    • T
      Modify AtEOXact_CatCache and AtEOXact_RelationCache to assume that the · 4568e0f7
      Tom Lane 提交于
      ResourceOwner mechanism already released all reference counts for the
      cache entries; therefore, we do not need to scan the catcache or relcache
      at transaction end, unless we want to do it as a debugging crosscheck.
      Do the crosscheck only in Assert mode.  This is the same logic we had
      previously installed in AtEOXact_Buffers to avoid overhead with large
      numbers of shared buffers.  I thought it'd be a good idea to do it here
      too, in view of Kari Lavikka's recent report showing a real-world case
      where AtEOXact_CatCache is taking a significant fraction of runtime.
      4568e0f7
  36. 29 5月, 2005 1 次提交
    • T
      Modify hash_search() API to prevent future occurrences of the error · e92a8827
      Tom Lane 提交于
      spotted by Qingqing Zhou.  The HASH_ENTER action now automatically
      fails with elog(ERROR) on out-of-memory --- which incidentally lets
      us eliminate duplicate error checks in quite a bunch of places.  If
      you really need the old return-NULL-on-out-of-memory behavior, you
      can ask for HASH_ENTER_NULL.  But there is now an Assert in that path
      checking that you aren't hoping to get that behavior in a palloc-based
      hash table.
      Along the way, remove the old HASH_FIND_SAVE/HASH_REMOVE_SAVED actions,
      which were not being used anywhere anymore, and were surely too ugly
      and unsafe to want to see revived again.
      e92a8827
  37. 28 5月, 2005 1 次提交
    • T
      Arrange to cache fmgr lookup information for an index's access method · 32e8fc4a
      Tom Lane 提交于
      routines in the index's relcache entry, instead of doing a fresh fmgr_info
      on every index access.  We were already doing this for the index's opclass
      support functions; not sure why we didn't think to do it for the AM
      functions too.  This supersedes the former method of caching (only)
      amgettuple in indexscan scan descriptors; it's an improvement because the
      function lookup can be amortized across multiple statements instead of
      being repeated for each statement.  Even though lookup for builtin
      functions is pretty cheap, this seems to drop a percent or two off some
      simple benchmarks.
      32e8fc4a
  38. 11 5月, 2005 1 次提交