summaryrefslogtreecommitdiff
path: root/src/backend/access/brin/brin.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2018-03-14 11:53:56 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2018-03-14 12:00:53 -0300
commiteadcb7a2377a7a68dee24f750b61a2ac0d7f9f40 (patch)
tree0efa0e871c5f09e1504665d07ec0d0e938a23f40 /src/backend/access/brin/brin.c
parent8559b40c5e3fb068d0dfd81d4a5a9f7411f2cbba (diff)
Log when a BRIN autosummarization request fails
Autovacuum's 'workitem' request queue is of limited size, so requests can fail if they arrive more quickly than autovacuum can process them. Emit a log message when this happens, to provide better visibility of this. Backpatch to 10. While this represents an API change for AutoVacuumRequestWork, that function is not yet prepared to deal with external modules calling it, so there doesn't seem to be any risk (other than log spam, that is.) Author: Masahiko Sawada Reviewed-by: Fabrízio Mello, Ildar Musin, Álvaro Herrera Discussion: https://postgr.es/m/CAD21AoB1HrQhp6_4rTyHN5kWEJCEsG8YzsjZNt-ctoXSn5Uisw@mail.gmail.com
Diffstat (limited to 'src/backend/access/brin/brin.c')
-rw-r--r--src/backend/access/brin/brin.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/backend/access/brin/brin.c b/src/backend/access/brin/brin.c
index 4f0ff79cb49..7f4600f18d6 100644
--- a/src/backend/access/brin/brin.c
+++ b/src/backend/access/brin/brin.c
@@ -187,9 +187,19 @@ brininsert(Relation idxRel, Datum *values, bool *nulls,
brinGetTupleForHeapBlock(revmap, lastPageRange, &buf, &off,
NULL, BUFFER_LOCK_SHARE, NULL);
if (!lastPageTuple)
- AutoVacuumRequestWork(AVW_BRINSummarizeRange,
- RelationGetRelid(idxRel),
- lastPageRange);
+ {
+ bool recorded;
+
+ recorded = AutoVacuumRequestWork(AVW_BRINSummarizeRange,
+ RelationGetRelid(idxRel),
+ lastPageRange);
+ if (!recorded)
+ ereport(LOG,
+ (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
+ errmsg("request for BRIN range summarization for index \"%s\" page %u was not recorded",
+ RelationGetRelationName(idxRel),
+ lastPageRange)));
+ }
else
LockBuffer(buf, BUFFER_LOCK_UNLOCK);
}