Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
2958a672
Commit
2958a672
authored
Dec 29, 2017
by
Simon Riggs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend near-wraparound hints to include replication slots
Author: Feike Steenbergen Reviewed-by: Michael Paquier
parent
0aa1d489
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
16 deletions
+19
-16
doc/src/sgml/logicaldecoding.sgml
doc/src/sgml/logicaldecoding.sgml
+5
-3
src/backend/access/transam/multixact.c
src/backend/access/transam/multixact.c
+6
-6
src/backend/access/transam/varsup.c
src/backend/access/transam/varsup.c
+6
-6
src/backend/commands/vacuum.c
src/backend/commands/vacuum.c
+2
-1
No files found.
doc/src/sgml/logicaldecoding.sgml
View file @
2958a672
...
...
@@ -248,16 +248,18 @@ $ pg_recvlogical -d postgres --slot test --drop-slot
may consume changes from a slot at any given time.
</para>
<
note
>
<
caution
>
<para>
Replication slots persist across crashes and know nothing about the state
of their consumer(s). They will prevent removal of required resources
even when there is no connection using them. This consumes storage
because neither required WAL nor required rows from the system catalogs
can be removed by <command>VACUUM</command> as long as they are required by a replication
slot. So if a slot is no longer required it should be dropped.
slot. In extreme cases this could cause the database to shut down to prevent
transaction ID wraparound (see <xref linkend="vacuum-for-wraparound"/>).
So if a slot is no longer required it should be dropped.
</para>
</
note
>
</
caution
>
</sect2>
<sect2>
...
...
src/backend/access/transam/multixact.c
View file @
2958a672
...
...
@@ -1000,14 +1000,14 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
errmsg
(
"database is not accepting commands that generate new MultiXactIds to avoid wraparound data loss in database
\"
%s
\"
"
,
oldest_datname
),
errhint
(
"Execute a database-wide VACUUM in that database.
\n
"
"You might also need to commit or roll back old prepared transactions."
)));
"You might also need to commit or roll back old prepared transactions
, or drop stale replication slots
."
)));
else
ereport
(
ERROR
,
(
errcode
(
ERRCODE_PROGRAM_LIMIT_EXCEEDED
),
errmsg
(
"database is not accepting commands that generate new MultiXactIds to avoid wraparound data loss in database with OID %u"
,
oldest_datoid
),
errhint
(
"Execute a database-wide VACUUM in that database.
\n
"
"You might also need to commit or roll back old prepared transactions."
)));
"You might also need to commit or roll back old prepared transactions
, or drop stale replication slots
."
)));
}
/*
...
...
@@ -1031,7 +1031,7 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
oldest_datname
,
multiWrapLimit
-
result
),
errhint
(
"Execute a database-wide VACUUM in that database.
\n
"
"You might also need to commit or roll back old prepared transactions."
)));
"You might also need to commit or roll back old prepared transactions
, or drop stale replication slots
."
)));
else
ereport
(
WARNING
,
(
errmsg_plural
(
"database with OID %u must be vacuumed before %u more MultiXactId is used"
,
...
...
@@ -1040,7 +1040,7 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
oldest_datoid
,
multiWrapLimit
-
result
),
errhint
(
"Execute a database-wide VACUUM in that database.
\n
"
"You might also need to commit or roll back old prepared transactions."
)));
"You might also need to commit or roll back old prepared transactions
, or drop stale replication slots
."
)));
}
/* Re-acquire lock and start over */
...
...
@@ -2321,7 +2321,7 @@ SetMultiXactIdLimit(MultiXactId oldest_datminmxid, Oid oldest_datoid,
oldest_datname
,
multiWrapLimit
-
curMulti
),
errhint
(
"To avoid a database shutdown, execute a database-wide VACUUM in that database.
\n
"
"You might also need to commit or roll back old prepared transactions."
)));
"You might also need to commit or roll back old prepared transactions
, or drop stale replication slots
."
)));
else
ereport
(
WARNING
,
(
errmsg_plural
(
"database with OID %u must be vacuumed before %u more MultiXactId is used"
,
...
...
@@ -2330,7 +2330,7 @@ SetMultiXactIdLimit(MultiXactId oldest_datminmxid, Oid oldest_datoid,
oldest_datoid
,
multiWrapLimit
-
curMulti
),
errhint
(
"To avoid a database shutdown, execute a database-wide VACUUM in that database.
\n
"
"You might also need to commit or roll back old prepared transactions."
)));
"You might also need to commit or roll back old prepared transactions
, or drop stale replication slots
."
)));
}
}
...
...
src/backend/access/transam/varsup.c
View file @
2958a672
...
...
@@ -124,14 +124,14 @@ GetNewTransactionId(bool isSubXact)
errmsg
(
"database is not accepting commands to avoid wraparound data loss in database
\"
%s
\"
"
,
oldest_datname
),
errhint
(
"Stop the postmaster and vacuum that database in single-user mode.
\n
"
"You might also need to commit or roll back old prepared transactions."
)));
"You might also need to commit or roll back old prepared transactions
, or drop stale replication slots
."
)));
else
ereport
(
ERROR
,
(
errcode
(
ERRCODE_PROGRAM_LIMIT_EXCEEDED
),
errmsg
(
"database is not accepting commands to avoid wraparound data loss in database with OID %u"
,
oldest_datoid
),
errhint
(
"Stop the postmaster and vacuum that database in single-user mode.
\n
"
"You might also need to commit or roll back old prepared transactions."
)));
"You might also need to commit or roll back old prepared transactions
, or drop stale replication slots
."
)));
}
else
if
(
TransactionIdFollowsOrEquals
(
xid
,
xidWarnLimit
))
{
...
...
@@ -144,14 +144,14 @@ GetNewTransactionId(bool isSubXact)
oldest_datname
,
xidWrapLimit
-
xid
),
errhint
(
"To avoid a database shutdown, execute a database-wide VACUUM in that database.
\n
"
"You might also need to commit or roll back old prepared transactions."
)));
"You might also need to commit or roll back old prepared transactions
, or drop stale replication slots
."
)));
else
ereport
(
WARNING
,
(
errmsg
(
"database with OID %u must be vacuumed within %u transactions"
,
oldest_datoid
,
xidWrapLimit
-
xid
),
errhint
(
"To avoid a database shutdown, execute a database-wide VACUUM in that database.
\n
"
"You might also need to commit or roll back old prepared transactions."
)));
"You might also need to commit or roll back old prepared transactions
, or drop stale replication slots
."
)));
}
/* Re-acquire lock and start over */
...
...
@@ -403,14 +403,14 @@ SetTransactionIdLimit(TransactionId oldest_datfrozenxid, Oid oldest_datoid)
oldest_datname
,
xidWrapLimit
-
curXid
),
errhint
(
"To avoid a database shutdown, execute a database-wide VACUUM in that database.
\n
"
"You might also need to commit or roll back old prepared transactions."
)));
"You might also need to commit or roll back old prepared transactions
, or drop stale replication slots
."
)));
else
ereport
(
WARNING
,
(
errmsg
(
"database with OID %u must be vacuumed within %u transactions"
,
oldest_datoid
,
xidWrapLimit
-
curXid
),
errhint
(
"To avoid a database shutdown, execute a database-wide VACUUM in that database.
\n
"
"You might also need to commit or roll back old prepared transactions."
)));
"You might also need to commit or roll back old prepared transactions
, or drop stale replication slots
."
)));
}
}
...
...
src/backend/commands/vacuum.c
View file @
2958a672
...
...
@@ -655,7 +655,8 @@ vacuum_set_xid_limits(Relation rel,
{
ereport
(
WARNING
,
(
errmsg
(
"oldest xmin is far in the past"
),
errhint
(
"Close open transactions soon to avoid wraparound problems."
)));
errhint
(
"Close open transactions soon to avoid wraparound problems.
\n
"
"You might also need to commit or roll back old prepared transactions, or drop stale replication slots."
)));
limit
=
*
oldestXmin
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment