aboutsummaryrefslogtreecommitdiff
path: root/src/backend
Commit message (Collapse)AuthorAge
* Rename PM_RECOVERY_CONSISTENT and PMSIGNAL_RECOVERY_CONSISTENT.Robert Haas2010-05-15
| | | | | The new names PM_HOT_STANDBY and PMSIGNAL_BEGIN_HOT_STANDBY more accurately reflect their actual function.
* Fix bug in processing of checkpoint time for max_standby_delay. LatestSimon Riggs2010-05-15
| | | | | log time was incorrectly set, typically leading to dates in the past, which would cause more cancellations in Hot Standby on a quiet server.
* We now accept read-only connections in state PM_RECOVERY_CONSISTENT.Robert Haas2010-05-14
|
* Remove CRs.Itagaki Takahiro2010-05-14
|
* Add many new Asserts in code and fix simple bug that slipped throughSimon Riggs2010-05-14
| | | | without them, related to previous commit. Report by Bruce Momjian.
* Translation updatePeter Eisentraut2010-05-13
|
* Fix vpath installation from distribution tarball (bug #5447)Peter Eisentraut2010-05-13
|
* Ensure that top level aborts call XLogSetAsyncCommit(). Not doingSimon Riggs2010-05-13
| | | | | | | | so simply leads to data waiting in wal_buffers which then causes later commits to potentially do emergency writes and for all forms of replication to be potentially delayed without need or benefit. Issue pointed out exactly by Fujii Masao, following bug report by Robert Haas on a separate though related topic.
* Cleanup initialization of Hot Standby. Clarify working with reanalysisSimon Riggs2010-05-13
| | | | | | | | | of requirements and documentation on LogStandbySnapshot(). Fixes two minor bugs reported by Tom Lane that would lead to an incorrect snapshot after transaction wraparound. Also fix two other problems discovered that would give incorrect snapshots in certain cases. ProcArrayApplyRecoveryInfo() substantially rewritten. Some minor refactoring of xact_redo_apply() and ExpireTreeKnownAssignedTransactionIds().
* Update comment about why postmaster doesn't get an icon.Bruce Momjian2010-05-12
|
* Remove Makefile PGFILEDESC tag that the postmaster is an executable.Bruce Momjian2010-05-12
|
* Give most recovery conflict errors a retryable error code. From recentSimon Riggs2010-05-12
| | | | requests and discussions with Yeb Havinga and Kevin Grittner.
* Add PGFILEDESC description to Makefiles for all /contrib executables.Bruce Momjian2010-05-12
| | | | Add PGAPPICON to all executable makefiles.
* Cause the archiver process to adopt new postgresql.conf settings (particularlyTom Lane2010-05-11
| | | | | | | | | | archive_command) as soon as possible, namely just before issuing a new call of archive_command, even when there is a backlog of files to be archived. The original coding would only absorb new settings after clearing the backlog and returning to the outer loop. Per discussion. Back-patch to 8.3. The logic in prior versions is a bit different and it doesn't seem worth taking any risks of breaking it.
* Fix incorrect patch that removed permission checks on inheritance childTom Lane2010-05-11
| | | | | tables --- the parent table no longer got checked, either. Per bug #5458 from Takahiro Itagaki.
* Set per-function GUC settings during validating the function.Itagaki Takahiro2010-05-11
| | | | | | | Now validators work properly even when the settings contain parameters that affect behavior of the function, like search_path. Reported by Erwin Brandstetter.
* When adding a "target IS NOT NULL" indexqual to the plan for an index-optimizedTom Lane2010-05-10
| | | | | | | | | MIN or MAX, we must take care to insert the added qual in a legal place among the existing indexquals, if any. The btree index AM requires the quals to appear in index-column order. We didn't have to worry about this before because "target IS NOT NULL" was just treated as a plain scan filter condition; but as of 9.0 it can be an index qual and then it has to follow the rule. Per report from Ian Barwick.
* Fix missing static declaration for XLogRead().Tom Lane2010-05-09
|
* Adjust comments about avoiding use of printf's %.*s.Tom Lane2010-05-09
| | | | | | | | | | | My initial impression that glibc was measuring the precision in characters (which is what the Linux man page says it does) was incorrect. It does take the precision to be in bytes, but it also tries to truncate the string at a character boundary. The bottom line remains the same: it will mess up if the string is not in the encoding it expects, so we need to avoid %.*s anytime there's a significant risk of that. Previous code changes are still good, but adjust the comments to reflect this knowledge. Per research by Hernan Gonzalez.
* Work around a subtle portability problem in use of printf %s format.Tom Lane2010-05-08
| | | | | | | | | | | | | Depending on which spec you read, field widths and precisions in %s may be counted either in bytes or characters. Our code was assuming bytes, which is wrong at least for glibc's implementation, and in any case libc might have a different idea of the prevailing encoding than we do. Hence, for portable results we must avoid using anything more complex than just "%s" unless the string to be printed is known to be all-ASCII. This patch fixes the cases I could find, including the psql formatting failure reported by Hernan Gonzalez. In HEAD only, I also added comments to some places where it appears safe to continue using "%.*s".
* Need to hold ControlFileLock while updating control file. UpdateHeikki Linnakangas2010-05-03
| | | | | | minRecoveryPoint in control file when replaying a parameter change record, to ensure that we don't allow hot standby on WAL generated without wal_level='hot_standby' after a standby restart.
* Improve printing of XLOG_HEAP_NEWPAGE records to include the forknum.Tom Lane2010-05-02
|
* Fix replay of XLOG_HEAP_NEWPAGE WAL records to pay attention to the forknumTom Lane2010-05-02
| | | | | | | | | | | | | | | field of the WAL record. The previous coding always wrote to the main fork, resulting in data corruption if the page was meant to go into a non-default fork. At present, the only operation that can produce such WAL records is ALTER TABLE/INDEX SET TABLESPACE when executed with archive_mode = on. Data corruption would be observed on standby slaves, and could occur on the master as well if a database crash and recovery occurred after committing the ALTER and before the next checkpoint. Per report from Gordon Shannon. Back-patch to 8.4; the problem doesn't exist in earlier branches because we didn't have a concept of multiple relation forks then.
* Clean up some awkward, inaccurate, and inefficient processing aroundTom Lane2010-05-02
| | | | | | | | | | | | MaxStandbyDelay. Use the GUC units mechanism for the value, and choose more appropriate timestamp functions for performing tests with it. Make the ps_activity manipulation in ResolveRecoveryConflictWithVirtualXIDs have behavior similar to ps_activity code elsewhere, notably not updating the display when update_process_title is off and not truncating the display contents at an arbitrarily-chosen length. Improve the docs to be explicit about what MaxStandbyDelay actually measures, viz the difference between primary and standby servers' clocks, and the possible hazards if their clocks aren't in sync.
* Add code to InternalIpcMemoryCreate() to handle the case where shmget()Tom Lane2010-05-01
| | | | | | | | | | | | | | | | returns EINVAL for an existing shared memory segment. Although it's not terribly sensible, that behavior does meet the POSIX spec because EINVAL is the appropriate error code when the existing segment is smaller than the requested size, and the spec explicitly disclaims any particular ordering of error checks. Moreover, it does in fact happen on OS X and probably other BSD-derived kernels. (We were able to talk NetBSD into changing their code, but purging that behavior from the wild completely seems unlikely to happen.) We need to distinguish collision with a pre-existing segment from invalid size request in order to behave sensibly, so it's worth some extra code here to get it right. Per report from Gavin Kistner and subsequent investigation. Back-patch to all supported versions, since any of them could get used with a kernel having the debatable behavior.
* Fix handling of b-tree reuse WAL records when hot standby is disabled,Heikki Linnakangas2010-04-30
| | | | | and add missing code in btree_desc for them. This fixes the bug with "tree_redo: unknown op code 208" error reported by Jaime Casanova.
* Adjust error checks in pg_start_backup and pg_stop_backup to make it possibleTom Lane2010-04-29
| | | | | | to perform a backup without archive_mode being enabled. This gives up some user-error protection in order to improve usefulness for streaming-replication scenarios. Per discussion.
* Rename the parameter recovery_connections to hot_standby, to reduce possibleTom Lane2010-04-29
| | | | | | | | confusion with streaming-replication settings. Also, change its default value to "off", because of concern about executing new and poorly-tested code during ordinary non-replicating operation. Per discussion. In passing do some minor editing of related documentation.
* Modify information_schema._pg_keysequal() to avoid search path risk whenTom Lane2010-04-28
| | | | | | | contrib/intarray is loaded. Per bug #5417 from Kenaniah Cerny. Not forcing initdb since backend doesn't directly depend on this, and few people have run into it.
* Modify ShmemInitStruct and ShmemInitHash to throw errors internally,Tom Lane2010-04-28
| | | | | | | | | rather than returning NULL for some-but-not-all failures as they used to. Remove now-redundant tests for NULL from call sites. We had to do something about this because many call sites were failing to check for NULL; and changing it like this seems a lot more useful and mistake-proof than adding checks to the call sites without them.
* Introduce wal_level GUC to explicitly control if information needed forHeikki Linnakangas2010-04-28
| | | | | | | | | | | | | | | | | | | | | | archival or hot standby should be WAL-logged, instead of deducing that from other options like archive_mode. This replaces recovery_connections GUC in the primary, where it now has no effect, but it's still used in the standby to enable/disable hot standby. Remove the WAL-logging of "unlogged operations", like creating an index without WAL-logging and fsyncing it at the end. Instead, we keep a copy of the wal_mode setting and the settings that affect how much shared memory a hot standby server needs to track master transactions (max_connections, max_prepared_xacts, max_locks_per_xact) in pg_control. Whenever the settings change, at server restart, write a WAL record noting the new settings and update pg_control. This allows us to notice the change in those settings in the standby at the right moment, they used to be included in checkpoint records, but that meant that a changed value was not reflected in the standby until the first checkpoint after the change. Bump PG_CONTROL_VERSION and XLOG_PAGE_MAGIC. Whack XLOG_PAGE_MAGIC back to the sequence it used to follow, before hot standby and subsequent patches changed it to 0x9003.
* Modify the built-in text search parser to handle URLs more nearly accordingTom Lane2010-04-28
| | | | | | | | | | to RFC 3986. In particular, these characters now terminate the path part of a URL: '"', '<', '>', '\', '^', '`', '{', '|', '}'. The previous behavior was inconsistent and depended on whether a "?" was present in the path. Per gripe from Donald Fraser and spec research by Kevin Grittner. This is a pre-existing bug, but not back-patching since the risks of breaking existing applications seem to outweigh the benefits.
* Fix stupid typo in refnameRangeTblEntry() --- mea maxima culpa.Tom Lane2010-04-28
| | | | Per report from Josh.
* Replace the KnownAssignedXids hash table with a sorted-array data structure,Tom Lane2010-04-28
| | | | | | | | and be more tense about the locking requirements for it, to improve performance in Hot Standby mode. In passing fix a few bugs and improve a number of comments in the existing HS code. Simon Riggs, with some editorialization by Tom
* If a base backup is cancelled by server shutdown or crash, throw an errorHeikki Linnakangas2010-04-27
| | | | | | | in WAL recovery when it sees the shutdown checkpoint record. It's more user-friendly to find out about it at that point than at the end of recovery, and you're not left wondering why your hot standby server never opens up for read-only connections.
* Add missing newlines in WPARSER_TRACE output.Tom Lane2010-04-26
|
* Reorder pg_stat_activity columns to be more consistent, using layoutBruce Momjian2010-04-26
| | | | | | suggested by Tom Lane. Catalog version bumped due to system view change.
* Add comments about why we set LC_CTYPE in WIN32 for time when we don'tBruce Momjian2010-04-26
| | | | actually access it, per information from Hiroshi.
* When we're restricting who can connect, don't allow new walsenders.Robert Haas2010-04-26
| | | | | | | | Normal superuser processes are allowed to connect even when the database system is shutting down, or when fewer than superuser_reserved_connection slots remain. This is intended to make sure an administrator can log in and troubleshoot, so don't extend these same courtesies to users connecting for replication.
* Add C comments for recent to_char('L') fix for Win32.Bruce Momjian2010-04-24
|
* Patch revoked because of objections.Simon Riggs2010-04-24
|
* Fix various instances of "the the".Robert Haas2010-04-23
| | | | Two of these were pointed out by Erik Rijkers; the rest I found.
* Add missing optimizer hooks for function cost and number of rows.Simon Riggs2010-04-23
| | | | | Closely follow design of other optimizer hooks: if hook exists retrieve value from plugin; if still not set then get from cache.
* Previous patch revoked following objections.Simon Riggs2010-04-23
|
* Make CheckRequiredParameterValues() depend upon correct combinationSimon Riggs2010-04-23
| | | | | | | of parameters. Fix bug report by Robert Haas that error message and hint was incorrect if wrong mode parameters specified on master. Internal changes only. Proposals for parameter simplification on master/primary still under way.
* Fix message punctuationPeter Eisentraut2010-04-22
|
* Optimise btree delete processing when no active backends.Simon Riggs2010-04-22
| | | | | Clarify comments, downgrade a message to DEBUG and remove some debug counters. Direct from ideas by Heikki Linnakangas.
* Further reductions in Hot Standby conflict processing. TheseSimon Riggs2010-04-22
| | | | | | | | | come from the realistion that HEAP2_CLEAN records don't always remove user visible data, so conflict processing for them can be skipped. Confirm validity using Assert checks, clarify circumstances under which we log heap_cleanup_info records. Tuning arises from bug fixing of earlier safety check failures.
* Fix encoding issue when lc_monetary or lc_numeric are different encodingItagaki Takahiro2010-04-22
| | | | | | | | | from lc_ctype, that could happen on Windows. We need to change lc_ctype together with lc_monetary or lc_numeric, and convert strings in lconv from lc_ctype encoding to the database encoding. The bug reported by Mikko, original patch by Hiroshi Inoue, with changes by Bruce and me.
* Enforce superuser permissions checks during ALTER ROLE/DATABASE SET, ratherTom Lane2010-04-21
| | | | | | | | | | | | than during define_custom_variable(). This entails rejecting an ALTER command if the target variable doesn't have a known (non-placeholder) definition, unless the calling user is superuser. When the variable *is* known, we can correctly apply the rule that only superusers can issue ALTER for SUSET parameters. This allows define_custom_variable to apply ALTER's values for SUSET parameters at module load time, secure in the knowledge that only a superuser could have set the ALTER value. This change fixes a longstanding gotcha in the usage of SUSET-level custom parameters; which is a good thing to fix now that plpgsql defines such a parameter.