agora inbox for [email protected]help / color / mirror / Atom feed
[PATCH 1/8] Pass all scan keys to BRIN consistent function at once 13+ messages / 2 participants [nested] [flat]
* [PATCH 1/8] Pass all scan keys to BRIN consistent function at once @ 2020-09-12 13:07 Tomas Vondra <[email protected]> 0 siblings, 0 replies; 13+ messages in thread From: Tomas Vondra @ 2020-09-12 13:07 UTC (permalink / raw) Passing all scan keys to the BRIN consistent function at once may allow elimination of additional ranges, which would be impossible when only passing individual scan keys. The code continues to support both the original (one scan key at a time) and new (all scan keys at once) approaches, depending on whether the consistent function accepts three or four arguments. This modifies the existing BRIN opclasses (minmax, inclusion) although those don't really benefit from this change. The primary purpose of this is to allow more advanced opclases in the future. Author: Tomas Vondra <[email protected]> Reviewed-by: Alvaro Herrera <[email protected]> Reviewed-by: Mark Dilger <[email protected]> Reviewed-by: Alexander Korotkov <[email protected]> Discussion: https://postgr.es/m/[email protected] --- src/backend/access/brin/brin.c | 150 +++++++++++++++----- src/backend/access/brin/brin_inclusion.c | 170 +++++++++++++++-------- src/backend/access/brin/brin_minmax.c | 121 +++++++++++----- src/backend/access/brin/brin_validate.c | 4 +- src/include/catalog/pg_proc.dat | 4 +- 5 files changed, 324 insertions(+), 125 deletions(-) diff --git a/src/backend/access/brin/brin.c b/src/backend/access/brin/brin.c index 27ba596c6e..dc187153aa 100644 --- a/src/backend/access/brin/brin.c +++ b/src/backend/access/brin/brin.c @@ -390,6 +390,9 @@ bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm) BrinMemTuple *dtup; BrinTuple *btup = NULL; Size btupsz = 0; + ScanKey **keys; + int *nkeys; + int keyno; opaque = (BrinOpaque *) scan->opaque; bdesc = opaque->bo_bdesc; @@ -411,6 +414,61 @@ bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm) */ consistentFn = palloc0(sizeof(FmgrInfo) * bdesc->bd_tupdesc->natts); + /* + * Make room for per-attribute lists of scan keys that we'll pass to the + * consistent support procedure. + */ + keys = palloc0(sizeof(ScanKey *) * bdesc->bd_tupdesc->natts); + nkeys = palloc0(sizeof(int) * bdesc->bd_tupdesc->natts); + + /* + * Preprocess the scan keys - split them into per-attribute arrays. + */ + for (keyno = 0; keyno < scan->numberOfKeys; keyno++) + { + ScanKey key = &scan->keyData[keyno]; + AttrNumber keyattno = key->sk_attno; + + /* + * The collation of the scan key must match the collation + * used in the index column (but only if the search is not + * IS NULL/ IS NOT NULL). Otherwise we shouldn't be using + * this index ... + */ + Assert((key->sk_flags & SK_ISNULL) || + (key->sk_collation == + TupleDescAttr(bdesc->bd_tupdesc, + keyattno - 1)->attcollation)); + + /* First time we see this index attribute, so init as needed. */ + if (!keys[keyattno-1]) + { + FmgrInfo *tmp; + + /* + * This is a bit of an overkill - we don't know how many + * scan keys are there for this attribute, so we simply + * allocate the largest number possible. This may waste + * a bit of memory, but we only expect small number of + * scan keys in general, so this should be negligible, + * and it's cheaper than having to repalloc repeatedly. + */ + keys[keyattno - 1] = palloc0(sizeof(ScanKey) * scan->numberOfKeys); + + /* First time this column, so look up consistent function */ + Assert(consistentFn[keyattno - 1].fn_oid == InvalidOid); + + tmp = index_getprocinfo(idxRel, keyattno, + BRIN_PROCNUM_CONSISTENT); + fmgr_info_copy(&consistentFn[keyattno - 1], tmp, + CurrentMemoryContext); + } + + /* Add key to the per-attribute array. */ + keys[keyattno - 1][nkeys[keyattno - 1]] = key; + nkeys[keyattno - 1]++; + } + /* allocate an initial in-memory tuple, out of the per-range memcxt */ dtup = brin_new_memtuple(bdesc); @@ -471,7 +529,7 @@ bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm) } else { - int keyno; + int attno; /* * Compare scan keys with summary values stored for the range. @@ -481,51 +539,75 @@ bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm) * no keys. */ addrange = true; - for (keyno = 0; keyno < scan->numberOfKeys; keyno++) + for (attno = 1; attno <= bdesc->bd_tupdesc->natts; attno++) { - ScanKey key = &scan->keyData[keyno]; - AttrNumber keyattno = key->sk_attno; - BrinValues *bval = &dtup->bt_columns[keyattno - 1]; + BrinValues *bval; Datum add; - /* - * The collation of the scan key must match the collation - * used in the index column (but only if the search is not - * IS NULL/ IS NOT NULL). Otherwise we shouldn't be using - * this index ... - */ - Assert((key->sk_flags & SK_ISNULL) || - (key->sk_collation == - TupleDescAttr(bdesc->bd_tupdesc, - keyattno - 1)->attcollation)); + /* skip attributes without any san keys */ + if (nkeys[attno - 1] == 0) + continue; - /* First time this column? look up consistent function */ - if (consistentFn[keyattno - 1].fn_oid == InvalidOid) - { - FmgrInfo *tmp; + bval = &dtup->bt_columns[attno - 1]; - tmp = index_getprocinfo(idxRel, keyattno, - BRIN_PROCNUM_CONSISTENT); - fmgr_info_copy(&consistentFn[keyattno - 1], tmp, - CurrentMemoryContext); - } + Assert((nkeys[attno - 1] > 0) && + (nkeys[attno - 1] <= scan->numberOfKeys)); /* * Check whether the scan key is consistent with the page * range values; if so, have the pages in the range added * to the output bitmap. * - * When there are multiple scan keys, failure to meet the - * criteria for a single one of them is enough to discard - * the range as a whole, so break out of the loop as soon - * as a false return value is obtained. + * The opclass may or may not support processing of multiple + * scan keys. We can determine that based on the number of + * arguments - functions with extra parameter (number of scan + * keys) do support this, otherwise we have to simply pass the + * scan keys one by one, */ - add = FunctionCall3Coll(&consistentFn[keyattno - 1], - key->sk_collation, - PointerGetDatum(bdesc), - PointerGetDatum(bval), - PointerGetDatum(key)); - addrange = DatumGetBool(add); + if (consistentFn[attno - 1].fn_nargs >= 4) + { + Oid collation; + + /* + * Collation from the first key (has to be the same for + * all keys for the same attribue). + */ + collation = keys[attno - 1][0]->sk_collation; + + /* Check all keys at once */ + add = FunctionCall4Coll(&consistentFn[attno - 1], + collation, + PointerGetDatum(bdesc), + PointerGetDatum(bval), + PointerGetDatum(keys[attno - 1]), + Int32GetDatum(nkeys[attno - 1])); + addrange = DatumGetBool(add); + } + else + { + /* + * Check keys one by one + * + * When there are multiple scan keys, failure to meet the + * criteria for a single one of them is enough to discard + * the range as a whole, so break out of the loop as soon + * as a false return value is obtained. + */ + int keyno; + + for (keyno = 0; keyno < nkeys[attno - 1]; keyno++) + { + add = FunctionCall3Coll(&consistentFn[attno - 1], + keys[attno - 1][keyno]->sk_collation, + PointerGetDatum(bdesc), + PointerGetDatum(bval), + PointerGetDatum(keys[attno - 1][keyno])); + addrange = DatumGetBool(add); + if (!addrange) + break; + } + } + if (!addrange) break; } diff --git a/src/backend/access/brin/brin_inclusion.c b/src/backend/access/brin/brin_inclusion.c index 12e5bddd1f..215bc794d3 100644 --- a/src/backend/access/brin/brin_inclusion.c +++ b/src/backend/access/brin/brin_inclusion.c @@ -85,6 +85,8 @@ static FmgrInfo *inclusion_get_procinfo(BrinDesc *bdesc, uint16 attno, uint16 procnum); static FmgrInfo *inclusion_get_strategy_procinfo(BrinDesc *bdesc, uint16 attno, Oid subtype, uint16 strategynum); +static bool inclusion_consistent_key(BrinDesc *bdesc, BrinValues *column, + ScanKey key, Oid colloid); /* @@ -258,53 +260,109 @@ brin_inclusion_consistent(PG_FUNCTION_ARGS) { BrinDesc *bdesc = (BrinDesc *) PG_GETARG_POINTER(0); BrinValues *column = (BrinValues *) PG_GETARG_POINTER(1); - ScanKey key = (ScanKey) PG_GETARG_POINTER(2); - Oid colloid = PG_GET_COLLATION(), - subtype; - Datum unionval; - AttrNumber attno; - Datum query; - FmgrInfo *finfo; - Datum result; - - Assert(key->sk_attno == column->bv_attno); + ScanKey *keys = (ScanKey *) PG_GETARG_POINTER(2); + int nkeys = PG_GETARG_INT32(3); + Oid colloid = PG_GET_COLLATION(); + int keyno; + bool regular_keys = false; - /* Handle IS NULL/IS NOT NULL tests. */ - if (key->sk_flags & SK_ISNULL) + /* + * First check if there are any IS NULL scan keys, and if we're + * violating them. In that case we can terminate early, without + * inspecting the ranges. + */ + for (keyno = 0; keyno < nkeys; keyno++) { - if (key->sk_flags & SK_SEARCHNULL) + ScanKey key = keys[keyno]; + + Assert(key->sk_attno == column->bv_attno); + + /* handle IS NULL/IS NOT NULL tests */ + if (key->sk_flags & SK_ISNULL) { - if (column->bv_allnulls || column->bv_hasnulls) - PG_RETURN_BOOL(true); - PG_RETURN_BOOL(false); - } + if (key->sk_flags & SK_SEARCHNULL) + { + if (column->bv_allnulls || column->bv_hasnulls) + continue; /* this key is fine, continue */ - /* - * For IS NOT NULL, we can only skip ranges that are known to have - * only nulls. - */ - if (key->sk_flags & SK_SEARCHNOTNULL) - PG_RETURN_BOOL(!column->bv_allnulls); + PG_RETURN_BOOL(false); + } - /* - * Neither IS NULL nor IS NOT NULL was used; assume all indexable - * operators are strict and return false. - */ - PG_RETURN_BOOL(false); + /* + * For IS NOT NULL, we can only skip ranges that are known to have + * only nulls. + */ + if (key->sk_flags & SK_SEARCHNOTNULL) + { + if (column->bv_allnulls) + PG_RETURN_BOOL(false); + + continue; + } + + /* + * Neither IS NULL nor IS NOT NULL was used; assume all indexable + * operators are strict and return false. + */ + PG_RETURN_BOOL(false); + } + else + /* note we have regular (non-NULL) scan keys */ + regular_keys = true; } - /* If it is all nulls, it cannot possibly be consistent. */ - if (column->bv_allnulls) + /* + * If the page range is all nulls, it cannot possibly be consistent if + * there are some regular scan keys. + */ + if (column->bv_allnulls && regular_keys) PG_RETURN_BOOL(false); + /* If there are no regular keys, the page range is considered consistent. */ + if (!regular_keys) + PG_RETURN_BOOL(true); + /* It has to be checked, if it contains elements that are not mergeable. */ if (DatumGetBool(column->bv_values[INCLUSION_UNMERGEABLE])) PG_RETURN_BOOL(true); - attno = key->sk_attno; - subtype = key->sk_subtype; - query = key->sk_argument; - unionval = column->bv_values[INCLUSION_UNION]; + /* Check that the range is consistent with all scan keys. */ + for (keyno = 0; keyno < nkeys; keyno++) + { + ScanKey key = keys[keyno]; + + /* ignore IS NULL/IS NOT NULL tests handled above */ + if (key->sk_flags & SK_ISNULL) + continue; + + /* + * When there are multiple scan keys, failure to meet the + * criteria for a single one of them is enough to discard + * the range as a whole, so break out of the loop as soon + * as a false return value is obtained. + */ + if (!inclusion_consistent_key(bdesc, column, key, colloid)) + PG_RETURN_BOOL(false); + } + + PG_RETURN_BOOL(true); +} + +/* + * inclusion_consistent_key + * Determine if the range is consistent with a single scan key. + */ +static bool +inclusion_consistent_key(BrinDesc *bdesc, BrinValues *column, ScanKey key, + Oid colloid) +{ + FmgrInfo *finfo; + AttrNumber attno = key->sk_attno; + Oid subtype = key->sk_subtype; + Datum query = key->sk_argument; + Datum unionval = column->bv_values[INCLUSION_UNION]; + Datum result; + switch (key->sk_strategy) { /* @@ -324,49 +382,49 @@ brin_inclusion_consistent(PG_FUNCTION_ARGS) finfo = inclusion_get_strategy_procinfo(bdesc, attno, subtype, RTOverRightStrategyNumber); result = FunctionCall2Coll(finfo, colloid, unionval, query); - PG_RETURN_BOOL(!DatumGetBool(result)); + return !DatumGetBool(result); case RTOverLeftStrategyNumber: finfo = inclusion_get_strategy_procinfo(bdesc, attno, subtype, RTRightStrategyNumber); result = FunctionCall2Coll(finfo, colloid, unionval, query); - PG_RETURN_BOOL(!DatumGetBool(result)); + return !DatumGetBool(result); case RTOverRightStrategyNumber: finfo = inclusion_get_strategy_procinfo(bdesc, attno, subtype, RTLeftStrategyNumber); result = FunctionCall2Coll(finfo, colloid, unionval, query); - PG_RETURN_BOOL(!DatumGetBool(result)); + return !DatumGetBool(result); case RTRightStrategyNumber: finfo = inclusion_get_strategy_procinfo(bdesc, attno, subtype, RTOverLeftStrategyNumber); result = FunctionCall2Coll(finfo, colloid, unionval, query); - PG_RETURN_BOOL(!DatumGetBool(result)); + return !DatumGetBool(result); case RTBelowStrategyNumber: finfo = inclusion_get_strategy_procinfo(bdesc, attno, subtype, RTOverAboveStrategyNumber); result = FunctionCall2Coll(finfo, colloid, unionval, query); - PG_RETURN_BOOL(!DatumGetBool(result)); + return !DatumGetBool(result); case RTOverBelowStrategyNumber: finfo = inclusion_get_strategy_procinfo(bdesc, attno, subtype, RTAboveStrategyNumber); result = FunctionCall2Coll(finfo, colloid, unionval, query); - PG_RETURN_BOOL(!DatumGetBool(result)); + return !DatumGetBool(result); case RTOverAboveStrategyNumber: finfo = inclusion_get_strategy_procinfo(bdesc, attno, subtype, RTBelowStrategyNumber); result = FunctionCall2Coll(finfo, colloid, unionval, query); - PG_RETURN_BOOL(!DatumGetBool(result)); + return !DatumGetBool(result); case RTAboveStrategyNumber: finfo = inclusion_get_strategy_procinfo(bdesc, attno, subtype, RTOverBelowStrategyNumber); result = FunctionCall2Coll(finfo, colloid, unionval, query); - PG_RETURN_BOOL(!DatumGetBool(result)); + return !DatumGetBool(result); /* * Overlap and contains strategies @@ -384,7 +442,7 @@ brin_inclusion_consistent(PG_FUNCTION_ARGS) finfo = inclusion_get_strategy_procinfo(bdesc, attno, subtype, key->sk_strategy); result = FunctionCall2Coll(finfo, colloid, unionval, query); - PG_RETURN_DATUM(result); + return DatumGetBool(result); /* * Contained by strategies @@ -404,9 +462,9 @@ brin_inclusion_consistent(PG_FUNCTION_ARGS) RTOverlapStrategyNumber); result = FunctionCall2Coll(finfo, colloid, unionval, query); if (DatumGetBool(result)) - PG_RETURN_BOOL(true); + return true; - PG_RETURN_DATUM(column->bv_values[INCLUSION_CONTAINS_EMPTY]); + return DatumGetBool(column->bv_values[INCLUSION_CONTAINS_EMPTY]); /* * Adjacent strategy @@ -423,12 +481,12 @@ brin_inclusion_consistent(PG_FUNCTION_ARGS) RTOverlapStrategyNumber); result = FunctionCall2Coll(finfo, colloid, unionval, query); if (DatumGetBool(result)) - PG_RETURN_BOOL(true); + return true; finfo = inclusion_get_strategy_procinfo(bdesc, attno, subtype, - RTAdjacentStrategyNumber); + RTAdjacentStrategyNumber); result = FunctionCall2Coll(finfo, colloid, unionval, query); - PG_RETURN_DATUM(result); + return DatumGetBool(result); /* * Basic comparison strategies @@ -458,9 +516,9 @@ brin_inclusion_consistent(PG_FUNCTION_ARGS) RTRightStrategyNumber); result = FunctionCall2Coll(finfo, colloid, unionval, query); if (!DatumGetBool(result)) - PG_RETURN_BOOL(true); + return true; - PG_RETURN_DATUM(column->bv_values[INCLUSION_CONTAINS_EMPTY]); + return DatumGetBool(column->bv_values[INCLUSION_CONTAINS_EMPTY]); case RTSameStrategyNumber: case RTEqualStrategyNumber: @@ -468,30 +526,30 @@ brin_inclusion_consistent(PG_FUNCTION_ARGS) RTContainsStrategyNumber); result = FunctionCall2Coll(finfo, colloid, unionval, query); if (DatumGetBool(result)) - PG_RETURN_BOOL(true); + return true; - PG_RETURN_DATUM(column->bv_values[INCLUSION_CONTAINS_EMPTY]); + return DatumGetBool(column->bv_values[INCLUSION_CONTAINS_EMPTY]); case RTGreaterEqualStrategyNumber: finfo = inclusion_get_strategy_procinfo(bdesc, attno, subtype, RTLeftStrategyNumber); result = FunctionCall2Coll(finfo, colloid, unionval, query); if (!DatumGetBool(result)) - PG_RETURN_BOOL(true); + return true; - PG_RETURN_DATUM(column->bv_values[INCLUSION_CONTAINS_EMPTY]); + return DatumGetBool(column->bv_values[INCLUSION_CONTAINS_EMPTY]); case RTGreaterStrategyNumber: /* no need to check for empty elements */ finfo = inclusion_get_strategy_procinfo(bdesc, attno, subtype, RTLeftStrategyNumber); result = FunctionCall2Coll(finfo, colloid, unionval, query); - PG_RETURN_BOOL(!DatumGetBool(result)); + return !DatumGetBool(result); default: /* shouldn't happen */ elog(ERROR, "invalid strategy number %d", key->sk_strategy); - PG_RETURN_BOOL(false); + return false; } } diff --git a/src/backend/access/brin/brin_minmax.c b/src/backend/access/brin/brin_minmax.c index 2ffbd9bf0d..12878ff3a0 100644 --- a/src/backend/access/brin/brin_minmax.c +++ b/src/backend/access/brin/brin_minmax.c @@ -30,6 +30,8 @@ typedef struct MinmaxOpaque static FmgrInfo *minmax_get_strategy_procinfo(BrinDesc *bdesc, uint16 attno, Oid subtype, uint16 strategynum); +static bool minmax_consistent_key(BrinDesc *bdesc, BrinValues *column, + ScanKey key, Oid colloid); Datum @@ -146,47 +148,104 @@ brin_minmax_consistent(PG_FUNCTION_ARGS) { BrinDesc *bdesc = (BrinDesc *) PG_GETARG_POINTER(0); BrinValues *column = (BrinValues *) PG_GETARG_POINTER(1); - ScanKey key = (ScanKey) PG_GETARG_POINTER(2); - Oid colloid = PG_GET_COLLATION(), - subtype; - AttrNumber attno; - Datum value; - Datum matches; - FmgrInfo *finfo; - - Assert(key->sk_attno == column->bv_attno); + ScanKey *keys = (ScanKey *) PG_GETARG_POINTER(2); + int nkeys = PG_GETARG_INT32(3); + Oid colloid = PG_GET_COLLATION(); + int keyno; + bool regular_keys = false; - /* handle IS NULL/IS NOT NULL tests */ - if (key->sk_flags & SK_ISNULL) + /* + * First check if there are any IS NULL scan keys, and if we're + * violating them. In that case we can terminate early, without + * inspecting the ranges. + */ + for (keyno = 0; keyno < nkeys; keyno++) { - if (key->sk_flags & SK_SEARCHNULL) + ScanKey key = keys[keyno]; + + Assert(key->sk_attno == column->bv_attno); + + /* handle IS NULL/IS NOT NULL tests */ + if (key->sk_flags & SK_ISNULL) { - if (column->bv_allnulls || column->bv_hasnulls) - PG_RETURN_BOOL(true); + if (key->sk_flags & SK_SEARCHNULL) + { + if (column->bv_allnulls || column->bv_hasnulls) + continue; /* this key is fine, continue */ + + PG_RETURN_BOOL(false); + } + + /* + * For IS NOT NULL, we can only skip ranges that are known to have + * only nulls. + */ + if (key->sk_flags & SK_SEARCHNOTNULL) + { + if (column->bv_allnulls) + PG_RETURN_BOOL(false); + + continue; + } + + /* + * Neither IS NULL nor IS NOT NULL was used; assume all indexable + * operators are strict and return false. + */ PG_RETURN_BOOL(false); } + else + /* note we have regular (non-NULL) scan keys */ + regular_keys = true; + } - /* - * For IS NOT NULL, we can only skip ranges that are known to have - * only nulls. - */ - if (key->sk_flags & SK_SEARCHNOTNULL) - PG_RETURN_BOOL(!column->bv_allnulls); + /* + * If the page range is all nulls, it cannot possibly be consistent if + * there are some regular scan keys. + */ + if (column->bv_allnulls && regular_keys) + PG_RETURN_BOOL(false); + + /* If there are no regular keys, the page range is considered consistent. */ + if (!regular_keys) + PG_RETURN_BOOL(true); - /* - * Neither IS NULL nor IS NOT NULL was used; assume all indexable - * operators are strict and return false. + /* Check that the range is consistent with all scan keys. */ + for (keyno = 0; keyno < nkeys; keyno++) + { + ScanKey key = keys[keyno]; + + /* ignore IS NULL/IS NOT NULL tests handled above */ + if (key->sk_flags & SK_ISNULL) + continue; + + /* + * When there are multiple scan keys, failure to meet the + * criteria for a single one of them is enough to discard + * the range as a whole, so break out of the loop as soon + * as a false return value is obtained. */ - PG_RETURN_BOOL(false); + if (!minmax_consistent_key(bdesc, column, key, colloid)) + PG_RETURN_DATUM(false);; } - /* if the range is all empty, it cannot possibly be consistent */ - if (column->bv_allnulls) - PG_RETURN_BOOL(false); + PG_RETURN_DATUM(true); +} + +/* + * minmax_consistent_key + * Determine if the range is consistent with a single scan key. + */ +static bool +minmax_consistent_key(BrinDesc *bdesc, BrinValues *column, ScanKey key, + Oid colloid) +{ + FmgrInfo *finfo; + AttrNumber attno = key->sk_attno; + Oid subtype = key->sk_subtype; + Datum value = key->sk_argument; + Datum matches; - attno = key->sk_attno; - subtype = key->sk_subtype; - value = key->sk_argument; switch (key->sk_strategy) { case BTLessStrategyNumber: @@ -229,7 +288,7 @@ brin_minmax_consistent(PG_FUNCTION_ARGS) break; } - PG_RETURN_DATUM(matches); + return DatumGetBool(matches); } /* diff --git a/src/backend/access/brin/brin_validate.c b/src/backend/access/brin/brin_validate.c index 6d4253c05e..11835d85cd 100644 --- a/src/backend/access/brin/brin_validate.c +++ b/src/backend/access/brin/brin_validate.c @@ -97,8 +97,8 @@ brinvalidate(Oid opclassoid) break; case BRIN_PROCNUM_CONSISTENT: ok = check_amproc_signature(procform->amproc, BOOLOID, true, - 3, 3, INTERNALOID, INTERNALOID, - INTERNALOID); + 3, 4, INTERNALOID, INTERNALOID, + INTERNALOID, INT4OID); break; case BRIN_PROCNUM_UNION: ok = check_amproc_signature(procform->amproc, BOOLOID, true, diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index b5f52d4e4a..2ef11245a8 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -8183,7 +8183,7 @@ prosrc => 'brin_minmax_add_value' }, { oid => '3385', descr => 'BRIN minmax support', proname => 'brin_minmax_consistent', prorettype => 'bool', - proargtypes => 'internal internal internal', + proargtypes => 'internal internal internal int4', prosrc => 'brin_minmax_consistent' }, { oid => '3386', descr => 'BRIN minmax support', proname => 'brin_minmax_union', prorettype => 'bool', @@ -8199,7 +8199,7 @@ prosrc => 'brin_inclusion_add_value' }, { oid => '4107', descr => 'BRIN inclusion support', proname => 'brin_inclusion_consistent', prorettype => 'bool', - proargtypes => 'internal internal internal', + proargtypes => 'internal internal internal int4', prosrc => 'brin_inclusion_consistent' }, { oid => '4108', descr => 'BRIN inclusion support', proname => 'brin_inclusion_union', prorettype => 'bool', -- 2.26.2 --------------FA974B75A0C3E9CA18CE7207 Content-Type: text/x-patch; charset=UTF-8; name="0002-Move-IS-NOT-NULL-handling-from-BRIN-support-20210122.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0002-Move-IS-NOT-NULL-handling-from-BRIN-support-20210122.pa"; filename*1="tch" ^ permalink raw reply [nested|flat] 13+ messages in thread
* [PATCH v14 6/7] restructure archive modules docs in preparation for restore modules @ 2023-02-15 22:48 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 13+ messages in thread From: Nathan Bossart @ 2023-02-15 22:48 UTC (permalink / raw) --- doc/src/sgml/archive-and-restore-modules.sgml | 207 ++++++++++-------- 1 file changed, 111 insertions(+), 96 deletions(-) diff --git a/doc/src/sgml/archive-and-restore-modules.sgml b/doc/src/sgml/archive-and-restore-modules.sgml index 7cf44e82e2..f30ee591e7 100644 --- a/doc/src/sgml/archive-and-restore-modules.sgml +++ b/doc/src/sgml/archive-and-restore-modules.sgml @@ -1,9 +1,9 @@ -<!-- doc/src/sgml/archive-modules.sgml --> +<!-- doc/src/sgml/archive-and-restore-modules.sgml --> -<chapter id="archive-modules"> - <title>Archive Modules</title> - <indexterm zone="archive-modules"> - <primary>Archive Modules</primary> +<chapter id="archive-and-restore-modules"> + <title>Archive and Restore Modules</title> + <indexterm zone="archive-and-restore-modules"> + <primary>Archive and Restore Modules</primary> </indexterm> <para> @@ -14,45 +14,53 @@ performant. </para> - <para> - When a custom <xref linkend="guc-archive-library"/> is configured, PostgreSQL - will submit completed WAL files to the module, and the server will avoid - recycling or removing these WAL files until the module indicates that the files - were successfully archived. It is ultimately up to the module to decide what - to do with each WAL file, but many recommendations are listed at - <xref linkend="backup-archiving-wal"/>. - </para> - - <para> - Archiving modules must at least consist of an initialization function (see - <xref linkend="archive-module-init"/>) and the required callbacks (see - <xref linkend="archive-module-callbacks"/>). However, archive modules are - also permitted to do much more (e.g., declare GUCs and register background - workers). - </para> - <para> The <filename>contrib/basic_archive</filename> module contains a working example, which demonstrates some useful techniques. </para> - <sect1 id="archive-module-init"> - <title>Initialization Functions</title> - <indexterm zone="archive-module-init"> - <primary>_PG_archive_module_init</primary> + <sect1 id="archive-modules"> + <title>Archive Modules</title> + <indexterm zone="archive-modules"> + <primary>Archive Modules</primary> </indexterm> + + <para> + When a custom <xref linkend="guc-archive-library"/> is configured, + PostgreSQL will submit completed WAL files to the module, and the server + will avoid recycling or removing these WAL files until the module indicates + that the files were successfully archived. It is ultimately up to the + module to decide what to do with each WAL file, but many recommendations are + listed at <xref linkend="backup-archiving-wal"/>. + </para> + <para> - An archive library is loaded by dynamically loading a shared library with the - <xref linkend="guc-archive-library"/>'s name as the library base name. The - normal library search path is used to locate the library. To provide the - required archive module callbacks and to indicate that the library is - actually an archive module, it needs to provide a function named - <function>_PG_archive_module_init</function>. The result of the function - must be a pointer to a struct of type - <structname>ArchiveModuleCallbacks</structname>, which contains everything - that the core code needs to know how to make use of the archive module. The - return value needs to be of server lifetime, which is typically achieved by - defining it as a <literal>static const</literal> variable in global scope. + Archiving modules must at least consist of an initialization function (see + <xref linkend="archive-module-init"/>) and the required callbacks (see + <xref linkend="archive-module-callbacks"/>). However, archive modules are + also permitted to do much more (e.g., declare GUCs and register background + workers). + </para> + + <sect2 id="archive-module-init"> + <title>Initialization Functions</title> + <indexterm zone="archive-module-init"> + <primary>_PG_archive_module_init</primary> + </indexterm> + + <para> + An archive library is loaded by dynamically loading a shared library with + the <xref linkend="guc-archive-library"/>'s name as the library base name. + The normal library search path is used to locate the library. To provide + the required archive module callbacks and to indicate that the library is + actually an archive module, it needs to provide a function named + <function>_PG_archive_module_init</function>. The result of the function + must be a pointer to a struct of type + <structname>ArchiveModuleCallbacks</structname>, which contains everything + that the core code needs to know how to make use of the archive module. + The return value needs to be of server lifetime, which is typically + achieved by defining it as a <literal>static const</literal> variable in + global scope. <programlisting> typedef struct ArchiveModuleCallbacks @@ -65,91 +73,98 @@ typedef struct ArchiveModuleCallbacks typedef const ArchiveModuleCallbacks *(*ArchiveModuleInit) (void); </programlisting> - Only the <function>archive_file_cb</function> callback is required. The - others are optional. - </para> - </sect1> + Only the <function>archive_file_cb</function> callback is required. The + others are optional. + </para> + </sect2> - <sect1 id="archive-module-callbacks"> - <title>Archive Module Callbacks</title> - <para> - The archive callbacks define the actual archiving behavior of the module. - The server will call them as required to process each individual WAL file. - </para> + <sect2 id="archive-module-callbacks"> + <title>Archive Module Callbacks</title> - <sect2 id="archive-module-startup"> - <title>Startup Callback</title> <para> - The <function>startup_cb</function> callback is called shortly after the - module is loaded. This callback can be used to perform any additional - initialization required. If the archive module has a state, it can use - <structfield>state->private_data</structfield> to store it. + The archive callbacks define the actual archiving behavior of the module. + The server will call them as required to process each individual WAL file. + </para> + + <sect3 id="archive-module-startup"> + <title>Startup Callback</title> + + <para> + The <function>startup_cb</function> callback is called shortly after the + module is loaded. This callback can be used to perform any additional + initialization required. If the archive module has state, it can use + <structfield>state->private_data</structfield> to store it. <programlisting> typedef void (*ArchiveStartupCB) (ArchiveModuleState *state); </programlisting> - </para> - </sect2> + </para> + </sect3> - <sect2 id="archive-module-check"> - <title>Check Callback</title> - <para> - The <function>check_configured_cb</function> callback is called to determine - whether the module is fully configured and ready to accept WAL files (e.g., - its configuration parameters are set to valid values). If no - <function>check_configured_cb</function> is defined, the server always - assumes the module is configured. + <sect3 id="archive-module-check"> + <title>Check Callback</title> + + <para> + The <function>check_configured_cb</function> callback is called to + determine whether the module is fully configured and ready to accept WAL + files (e.g., its configuration parameters are set to valid values). If no + <function>check_configured_cb</function> is defined, the server always + assumes the module is configured. <programlisting> typedef bool (*ArchiveCheckConfiguredCB) (ArchiveModuleState *state); </programlisting> - If <literal>true</literal> is returned, the server will proceed with - archiving the file by calling the <function>archive_file_cb</function> - callback. If <literal>false</literal> is returned, archiving will not - proceed, and the archiver will emit the following message to the server log: + If <literal>true</literal> is returned, the server will proceed with + archiving the file by calling the <function>archive_file_cb</function> + callback. If <literal>false</literal> is returned, archiving will not + proceed, and the archiver will emit the following message to the server + log: <screen> WARNING: archive_mode enabled, yet archiving is not configured </screen> - In the latter case, the server will periodically call this function, and - archiving will proceed only when it returns <literal>true</literal>. - </para> - </sect2> + In the latter case, the server will periodically call this function, and + archiving will proceed only when it returns <literal>true</literal>. + </para> + </sect3> - <sect2 id="archive-module-archive"> - <title>Archive Callback</title> - <para> - The <function>archive_file_cb</function> callback is called to archive a - single WAL file. + <sect3 id="archive-module-archive"> + <title>Archive Callback</title> + + <para> + The <function>archive_file_cb</function> callback is called to archive a + single WAL file. <programlisting> typedef bool (*ArchiveFileCB) (ArchiveModuleState *state, const char *file, const char *path); </programlisting> - If <literal>true</literal> is returned, the server proceeds as if the file - was successfully archived, which may include recycling or removing the - original WAL file. If <literal>false</literal> is returned, the server will - keep the original WAL file and retry archiving later. - <replaceable>file</replaceable> will contain just the file name of the WAL - file to archive, while <replaceable>path</replaceable> contains the full - path of the WAL file (including the file name). - </para> - </sect2> - - <sect2 id="archive-module-shutdown"> - <title>Shutdown Callback</title> - <para> - The <function>shutdown_cb</function> callback is called when the archiver - process exits (e.g., after an error) or the value of - <xref linkend="guc-archive-library"/> changes. If no - <function>shutdown_cb</function> is defined, no special action is taken in - these situations. If the archive module has a state, this callback should - free it to avoid leaks. + If <literal>true</literal> is returned, the server proceeds as if the file + was successfully archived, which may include recycling or removing the + original WAL file. If <literal>false</literal> is returned, the server + will keep the original WAL file and retry archiving later. + <replaceable>file</replaceable> will contain just the file name of the WAL + file to archive, while <replaceable>path</replaceable> contains the full + path of the WAL file (including the file name). + </para> + </sect3> + + <sect3 id="archive-module-shutdown"> + <title>Shutdown Callback</title> + + <para> + The <function>shutdown_cb</function> callback is called when the archiver + process exits (e.g., after an error) or the value of + <xref linkend="guc-archive-library"/> changes. If no + <function>shutdown_cb</function> is defined, no special action is taken in + these situations. If the archive module has state, this callback should + free it to avoid leaks. <programlisting> typedef void (*ArchiveShutdownCB) (ArchiveModuleState *state); </programlisting> - </para> + </para> + </sect3> </sect2> </sect1> </chapter> -- 2.25.1 --IS0zKkzwUGydFO0o Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v14-0007-introduce-restore_library.patch" ^ permalink raw reply [nested|flat] 13+ messages in thread
* [PATCH v22 4/5] restructure archive modules docs in preparation for restore modules @ 2023-02-15 22:48 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 13+ messages in thread From: Nathan Bossart @ 2023-02-15 22:48 UTC (permalink / raw) --- doc/src/sgml/archive-and-restore-modules.sgml | 242 +++++++++--------- 1 file changed, 128 insertions(+), 114 deletions(-) diff --git a/doc/src/sgml/archive-and-restore-modules.sgml b/doc/src/sgml/archive-and-restore-modules.sgml index 10ec96eae9..6e368290b9 100644 --- a/doc/src/sgml/archive-and-restore-modules.sgml +++ b/doc/src/sgml/archive-and-restore-modules.sgml @@ -1,9 +1,9 @@ -<!-- doc/src/sgml/archive-modules.sgml --> +<!-- doc/src/sgml/archive-and-restore-modules.sgml --> -<chapter id="archive-modules"> - <title>Archive Modules</title> - <indexterm zone="archive-modules"> - <primary>Archive Modules</primary> +<chapter id="archive-and-restore-modules"> + <title>Archive and Restore Modules</title> + <indexterm zone="archive-and-restore-modules"> + <primary>Archive and Restore Modules</primary> </indexterm> <para> @@ -14,45 +14,52 @@ performant. </para> - <para> - When a custom <xref linkend="guc-archive-library"/> is configured, PostgreSQL - will submit completed WAL files to the module, and the server will avoid - recycling or removing these WAL files until the module indicates that the files - were successfully archived. It is ultimately up to the module to decide what - to do with each WAL file, but many recommendations are listed at - <xref linkend="backup-archiving-wal"/>. - </para> - - <para> - Archiving modules must at least consist of an initialization function (see - <xref linkend="archive-module-init"/>) and the required callbacks (see - <xref linkend="archive-module-callbacks"/>). However, archive modules are - also permitted to do much more (e.g., declare GUCs and register background - workers). - </para> - <para> The <filename>contrib/basic_archive</filename> module contains a working example, which demonstrates some useful techniques. </para> - <sect1 id="archive-module-init"> - <title>Initialization Functions</title> - <indexterm zone="archive-module-init"> - <primary>_PG_archive_module_init</primary> + <sect1 id="archive-modules"> + <title>Archive Modules</title> + <indexterm zone="archive-modules"> + <primary>Archive Modules</primary> </indexterm> + + <para> + When a custom <xref linkend="guc-archive-library"/> is configured, + PostgreSQL will submit completed WAL files to the module, and the server + will avoid recycling or removing these WAL files until the module indicates + that the files were successfully archived. It is ultimately up to the + module to decide what to do with each WAL file, but many recommendations are + listed at <xref linkend="backup-archiving-wal"/>. + </para> + <para> - An archive library is loaded by dynamically loading a shared library with the - <xref linkend="guc-archive-library"/>'s name as the library base name. The - normal library search path is used to locate the library. To provide the - required archive module callbacks and to indicate that the library is - actually an archive module, it needs to provide a function named - <function>_PG_archive_module_init</function>. The result of the function - must be a pointer to a struct of type - <structname>ArchiveModuleCallbacks</structname>, which contains everything - that the core code needs to know to make use of the archive module. The - return value needs to be of server lifetime, which is typically achieved by - defining it as a <literal>static const</literal> variable in global scope. + Archiving modules must at least consist of an initialization function (see + <xref linkend="archive-module-init"/>) and the required callbacks (see + <xref linkend="archive-module-callbacks"/>). However, archive modules are + also permitted to do much more (e.g., declare GUCs and register background + workers). + </para> + + <sect2 id="archive-module-init"> + <title>Initialization Functions</title> + <indexterm zone="archive-module-init"> + <primary>_PG_archive_module_init</primary> + </indexterm> + + <para> + An archive library is loaded by dynamically loading a shared library with + the <xref linkend="guc-archive-library"/>'s name as the library base name. + The normal library search path is used to locate the library. To provide + the required archive module callbacks and to indicate that the library is + actually an archive module, it needs to provide a function named + <function>_PG_archive_module_init</function>. The result of the function + must be a pointer to a struct of type + <structname>ArchiveModuleCallbacks</structname>, which contains everything + that the core code needs to know to make use of the archive module. The + return value needs to be of server lifetime, which is typically achieved by + defining it as a <literal>static const</literal> variable in global scope. <programlisting> typedef struct ArchiveModuleCallbacks @@ -65,112 +72,119 @@ typedef struct ArchiveModuleCallbacks typedef const ArchiveModuleCallbacks *(*ArchiveModuleInit) (void); </programlisting> - Only the <function>archive_file_cb</function> callback is required. The - others are optional. - </para> - </sect1> + Only the <function>archive_file_cb</function> callback is required. The + others are optional. + </para> + </sect2> - <sect1 id="archive-module-callbacks"> - <title>Archive Module Callbacks</title> - <para> - The archive callbacks define the actual archiving behavior of the module. - The server will call them as required to process each individual WAL file. - </para> + <sect2 id="archive-module-callbacks"> + <title>Archive Module Callbacks</title> - <sect2 id="archive-module-startup"> - <title>Startup Callback</title> <para> - The <function>startup_cb</function> callback is called shortly after the - module is loaded. This callback can be used to perform any additional - initialization required. If the archive module has any state, it can use - <structfield>state->private_data</structfield> to store it. + The archive callbacks define the actual archiving behavior of the module. + The server will call them as required to process each individual WAL file. + </para> + + <sect3 id="archive-module-startup"> + <title>Startup Callback</title> + + <para> + The <function>startup_cb</function> callback is called shortly after the + module is loaded. This callback can be used to perform any additional + initialization required. If the archive module has any state, it can use + <structfield>state->private_data</structfield> to store it. <programlisting> typedef void (*ArchiveStartupCB) (ArchiveModuleState *state); </programlisting> - </para> - </sect2> + </para> + </sect3> - <sect2 id="archive-module-check"> - <title>Check Callback</title> - <para> - The <function>check_configured_cb</function> callback is called to determine - whether the module is fully configured and ready to accept WAL files (e.g., - its configuration parameters are set to valid values). If no - <function>check_configured_cb</function> is defined, the server always - assumes the module is configured. + <sect3 id="archive-module-check"> + <title>Check Callback</title> + + <para> + The <function>check_configured_cb</function> callback is called to + determine whether the module is fully configured and ready to accept WAL + files (e.g., its configuration parameters are set to valid values). If no + <function>check_configured_cb</function> is defined, the server always + assumes the module is configured. <programlisting> typedef bool (*ArchiveCheckConfiguredCB) (ArchiveModuleState *state); </programlisting> - If <literal>true</literal> is returned, the server will proceed with - archiving the file by calling the <function>archive_file_cb</function> - callback. If <literal>false</literal> is returned, archiving will not - proceed, and the archiver will emit the following message to the server log: + If <literal>true</literal> is returned, the server will proceed with + archiving the file by calling the <function>archive_file_cb</function> + callback. If <literal>false</literal> is returned, archiving will not + proceed, and the archiver will emit the following message to the server + log: <screen> WARNING: archive_mode enabled, yet archiving is not configured </screen> - In the latter case, the server will periodically call this function, and - archiving will proceed only when it returns <literal>true</literal>. - </para> - - <note> - <para> - When returning <literal>false</literal>, it may be useful to append some - additional information to the generic warning message. To do that, provide - a message to the <function>arch_module_check_errdetail</function> macro - before returning <literal>false</literal>. Like - <function>errdetail()</function>, this macro accepts a format string - followed by an optional list of arguments. The resulting string will be - emitted as the <literal>DETAIL</literal> line of the warning message. + In the latter case, the server will periodically call this function, and + archiving will proceed only when it returns <literal>true</literal>. </para> - </note> - </sect2> - <sect2 id="archive-module-archive"> - <title>Archive Callback</title> - <para> - The <function>archive_file_cb</function> callback is called to archive a - single WAL file. + <note> + <para> + When returning <literal>false</literal>, it may be useful to append some + additional information to the generic warning message. To do that, + provide a message to the <function>arch_module_check_errdetail</function> + macro before returning <literal>false</literal>. Like + <function>errdetail()</function>, this macro accepts a format string + followed by an optional list of arguments. The resulting string will be + emitted as the <literal>DETAIL</literal> line of the warning message. + </para> + </note> + </sect3> + + <sect3 id="archive-module-archive"> + <title>Archive Callback</title> + + <para> + The <function>archive_file_cb</function> callback is called to archive a + single WAL file. <programlisting> typedef bool (*ArchiveFileCB) (ArchiveModuleState *state, const char *file, const char *path); </programlisting> - If <literal>true</literal> is returned, the server proceeds as if the file - was successfully archived, which may include recycling or removing the - original WAL file. If <literal>false</literal> is returned or an error is thrown, the server will - keep the original WAL file and retry archiving later. - <replaceable>file</replaceable> will contain just the file name of the WAL - file to archive, while <replaceable>path</replaceable> contains the full - path of the WAL file (including the file name). - </para> - - <note> - <para> - The <function>archive_file_cb</function> callback is called in a - short-lived memory context that will be reset between invocations. If you - need longer-lived storage, create a memory context in the module's - <function>startup_cb</function> callback. + If <literal>true</literal> is returned, the server proceeds as if the file + was successfully archived, which may include recycling or removing the + original WAL file. If <literal>false</literal> is returned or an error is + thrown, the server will keep the original WAL file and retry archiving + later. <replaceable>file</replaceable> will contain just the file name of + the WAL file to archive, while <replaceable>path</replaceable> contains the + full path of the WAL file (including the file name). </para> - </note> - </sect2> - <sect2 id="archive-module-shutdown"> - <title>Shutdown Callback</title> - <para> - The <function>shutdown_cb</function> callback is called when the archiver - process exits (e.g., after an error) or the value of - <xref linkend="guc-archive-library"/> changes. If no - <function>shutdown_cb</function> is defined, no special action is taken in - these situations. If the archive module has any state, this callback should - free it to avoid leaks. + <note> + <para> + The <function>archive_file_cb</function> callback is called in a + short-lived memory context that will be reset between invocations. If you + need longer-lived storage, create a memory context in the module's + <function>startup_cb</function> callback. + </para> + </note> + </sect3> + + <sect3 id="archive-module-shutdown"> + <title>Shutdown Callback</title> + + <para> + The <function>shutdown_cb</function> callback is called when the archiver + process exits (e.g., after an error) or the value of + <xref linkend="guc-archive-library"/> changes. If no + <function>shutdown_cb</function> is defined, no special action is taken in + these situations. If the archive module has any state, this callback + should free it to avoid leaks. <programlisting> typedef void (*ArchiveShutdownCB) (ArchiveModuleState *state); </programlisting> - </para> + </para> + </sect3> </sect2> </sect1> </chapter> -- 2.25.1 --X1bOJ3K7DJ5YkBrT Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v22-0005-introduce-restore_library.patch" ^ permalink raw reply [nested|flat] 13+ messages in thread
* [PATCH v23 4/5] restructure archive modules docs in preparation for restore modules @ 2023-02-15 22:48 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 13+ messages in thread From: Nathan Bossart @ 2023-02-15 22:48 UTC (permalink / raw) --- doc/src/sgml/archive-and-restore-modules.sgml | 242 +++++++++--------- 1 file changed, 128 insertions(+), 114 deletions(-) diff --git a/doc/src/sgml/archive-and-restore-modules.sgml b/doc/src/sgml/archive-and-restore-modules.sgml index 10ec96eae9..6e368290b9 100644 --- a/doc/src/sgml/archive-and-restore-modules.sgml +++ b/doc/src/sgml/archive-and-restore-modules.sgml @@ -1,9 +1,9 @@ -<!-- doc/src/sgml/archive-modules.sgml --> +<!-- doc/src/sgml/archive-and-restore-modules.sgml --> -<chapter id="archive-modules"> - <title>Archive Modules</title> - <indexterm zone="archive-modules"> - <primary>Archive Modules</primary> +<chapter id="archive-and-restore-modules"> + <title>Archive and Restore Modules</title> + <indexterm zone="archive-and-restore-modules"> + <primary>Archive and Restore Modules</primary> </indexterm> <para> @@ -14,45 +14,52 @@ performant. </para> - <para> - When a custom <xref linkend="guc-archive-library"/> is configured, PostgreSQL - will submit completed WAL files to the module, and the server will avoid - recycling or removing these WAL files until the module indicates that the files - were successfully archived. It is ultimately up to the module to decide what - to do with each WAL file, but many recommendations are listed at - <xref linkend="backup-archiving-wal"/>. - </para> - - <para> - Archiving modules must at least consist of an initialization function (see - <xref linkend="archive-module-init"/>) and the required callbacks (see - <xref linkend="archive-module-callbacks"/>). However, archive modules are - also permitted to do much more (e.g., declare GUCs and register background - workers). - </para> - <para> The <filename>contrib/basic_archive</filename> module contains a working example, which demonstrates some useful techniques. </para> - <sect1 id="archive-module-init"> - <title>Initialization Functions</title> - <indexterm zone="archive-module-init"> - <primary>_PG_archive_module_init</primary> + <sect1 id="archive-modules"> + <title>Archive Modules</title> + <indexterm zone="archive-modules"> + <primary>Archive Modules</primary> </indexterm> + + <para> + When a custom <xref linkend="guc-archive-library"/> is configured, + PostgreSQL will submit completed WAL files to the module, and the server + will avoid recycling or removing these WAL files until the module indicates + that the files were successfully archived. It is ultimately up to the + module to decide what to do with each WAL file, but many recommendations are + listed at <xref linkend="backup-archiving-wal"/>. + </para> + <para> - An archive library is loaded by dynamically loading a shared library with the - <xref linkend="guc-archive-library"/>'s name as the library base name. The - normal library search path is used to locate the library. To provide the - required archive module callbacks and to indicate that the library is - actually an archive module, it needs to provide a function named - <function>_PG_archive_module_init</function>. The result of the function - must be a pointer to a struct of type - <structname>ArchiveModuleCallbacks</structname>, which contains everything - that the core code needs to know to make use of the archive module. The - return value needs to be of server lifetime, which is typically achieved by - defining it as a <literal>static const</literal> variable in global scope. + Archiving modules must at least consist of an initialization function (see + <xref linkend="archive-module-init"/>) and the required callbacks (see + <xref linkend="archive-module-callbacks"/>). However, archive modules are + also permitted to do much more (e.g., declare GUCs and register background + workers). + </para> + + <sect2 id="archive-module-init"> + <title>Initialization Functions</title> + <indexterm zone="archive-module-init"> + <primary>_PG_archive_module_init</primary> + </indexterm> + + <para> + An archive library is loaded by dynamically loading a shared library with + the <xref linkend="guc-archive-library"/>'s name as the library base name. + The normal library search path is used to locate the library. To provide + the required archive module callbacks and to indicate that the library is + actually an archive module, it needs to provide a function named + <function>_PG_archive_module_init</function>. The result of the function + must be a pointer to a struct of type + <structname>ArchiveModuleCallbacks</structname>, which contains everything + that the core code needs to know to make use of the archive module. The + return value needs to be of server lifetime, which is typically achieved by + defining it as a <literal>static const</literal> variable in global scope. <programlisting> typedef struct ArchiveModuleCallbacks @@ -65,112 +72,119 @@ typedef struct ArchiveModuleCallbacks typedef const ArchiveModuleCallbacks *(*ArchiveModuleInit) (void); </programlisting> - Only the <function>archive_file_cb</function> callback is required. The - others are optional. - </para> - </sect1> + Only the <function>archive_file_cb</function> callback is required. The + others are optional. + </para> + </sect2> - <sect1 id="archive-module-callbacks"> - <title>Archive Module Callbacks</title> - <para> - The archive callbacks define the actual archiving behavior of the module. - The server will call them as required to process each individual WAL file. - </para> + <sect2 id="archive-module-callbacks"> + <title>Archive Module Callbacks</title> - <sect2 id="archive-module-startup"> - <title>Startup Callback</title> <para> - The <function>startup_cb</function> callback is called shortly after the - module is loaded. This callback can be used to perform any additional - initialization required. If the archive module has any state, it can use - <structfield>state->private_data</structfield> to store it. + The archive callbacks define the actual archiving behavior of the module. + The server will call them as required to process each individual WAL file. + </para> + + <sect3 id="archive-module-startup"> + <title>Startup Callback</title> + + <para> + The <function>startup_cb</function> callback is called shortly after the + module is loaded. This callback can be used to perform any additional + initialization required. If the archive module has any state, it can use + <structfield>state->private_data</structfield> to store it. <programlisting> typedef void (*ArchiveStartupCB) (ArchiveModuleState *state); </programlisting> - </para> - </sect2> + </para> + </sect3> - <sect2 id="archive-module-check"> - <title>Check Callback</title> - <para> - The <function>check_configured_cb</function> callback is called to determine - whether the module is fully configured and ready to accept WAL files (e.g., - its configuration parameters are set to valid values). If no - <function>check_configured_cb</function> is defined, the server always - assumes the module is configured. + <sect3 id="archive-module-check"> + <title>Check Callback</title> + + <para> + The <function>check_configured_cb</function> callback is called to + determine whether the module is fully configured and ready to accept WAL + files (e.g., its configuration parameters are set to valid values). If no + <function>check_configured_cb</function> is defined, the server always + assumes the module is configured. <programlisting> typedef bool (*ArchiveCheckConfiguredCB) (ArchiveModuleState *state); </programlisting> - If <literal>true</literal> is returned, the server will proceed with - archiving the file by calling the <function>archive_file_cb</function> - callback. If <literal>false</literal> is returned, archiving will not - proceed, and the archiver will emit the following message to the server log: + If <literal>true</literal> is returned, the server will proceed with + archiving the file by calling the <function>archive_file_cb</function> + callback. If <literal>false</literal> is returned, archiving will not + proceed, and the archiver will emit the following message to the server + log: <screen> WARNING: archive_mode enabled, yet archiving is not configured </screen> - In the latter case, the server will periodically call this function, and - archiving will proceed only when it returns <literal>true</literal>. - </para> - - <note> - <para> - When returning <literal>false</literal>, it may be useful to append some - additional information to the generic warning message. To do that, provide - a message to the <function>arch_module_check_errdetail</function> macro - before returning <literal>false</literal>. Like - <function>errdetail()</function>, this macro accepts a format string - followed by an optional list of arguments. The resulting string will be - emitted as the <literal>DETAIL</literal> line of the warning message. + In the latter case, the server will periodically call this function, and + archiving will proceed only when it returns <literal>true</literal>. </para> - </note> - </sect2> - <sect2 id="archive-module-archive"> - <title>Archive Callback</title> - <para> - The <function>archive_file_cb</function> callback is called to archive a - single WAL file. + <note> + <para> + When returning <literal>false</literal>, it may be useful to append some + additional information to the generic warning message. To do that, + provide a message to the <function>arch_module_check_errdetail</function> + macro before returning <literal>false</literal>. Like + <function>errdetail()</function>, this macro accepts a format string + followed by an optional list of arguments. The resulting string will be + emitted as the <literal>DETAIL</literal> line of the warning message. + </para> + </note> + </sect3> + + <sect3 id="archive-module-archive"> + <title>Archive Callback</title> + + <para> + The <function>archive_file_cb</function> callback is called to archive a + single WAL file. <programlisting> typedef bool (*ArchiveFileCB) (ArchiveModuleState *state, const char *file, const char *path); </programlisting> - If <literal>true</literal> is returned, the server proceeds as if the file - was successfully archived, which may include recycling or removing the - original WAL file. If <literal>false</literal> is returned or an error is thrown, the server will - keep the original WAL file and retry archiving later. - <replaceable>file</replaceable> will contain just the file name of the WAL - file to archive, while <replaceable>path</replaceable> contains the full - path of the WAL file (including the file name). - </para> - - <note> - <para> - The <function>archive_file_cb</function> callback is called in a - short-lived memory context that will be reset between invocations. If you - need longer-lived storage, create a memory context in the module's - <function>startup_cb</function> callback. + If <literal>true</literal> is returned, the server proceeds as if the file + was successfully archived, which may include recycling or removing the + original WAL file. If <literal>false</literal> is returned or an error is + thrown, the server will keep the original WAL file and retry archiving + later. <replaceable>file</replaceable> will contain just the file name of + the WAL file to archive, while <replaceable>path</replaceable> contains the + full path of the WAL file (including the file name). </para> - </note> - </sect2> - <sect2 id="archive-module-shutdown"> - <title>Shutdown Callback</title> - <para> - The <function>shutdown_cb</function> callback is called when the archiver - process exits (e.g., after an error) or the value of - <xref linkend="guc-archive-library"/> changes. If no - <function>shutdown_cb</function> is defined, no special action is taken in - these situations. If the archive module has any state, this callback should - free it to avoid leaks. + <note> + <para> + The <function>archive_file_cb</function> callback is called in a + short-lived memory context that will be reset between invocations. If you + need longer-lived storage, create a memory context in the module's + <function>startup_cb</function> callback. + </para> + </note> + </sect3> + + <sect3 id="archive-module-shutdown"> + <title>Shutdown Callback</title> + + <para> + The <function>shutdown_cb</function> callback is called when the archiver + process exits (e.g., after an error) or the value of + <xref linkend="guc-archive-library"/> changes. If no + <function>shutdown_cb</function> is defined, no special action is taken in + these situations. If the archive module has any state, this callback + should free it to avoid leaks. <programlisting> typedef void (*ArchiveShutdownCB) (ArchiveModuleState *state); </programlisting> - </para> + </para> + </sect3> </sect2> </sect1> </chapter> -- 2.39.3 (Apple Git-146) --+lMYHr7JfqZnFv8q Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="v23-0005-introduce-restore_library.patch" ^ permalink raw reply [nested|flat] 13+ messages in thread
* [PATCH v18 4/5] restructure archive modules docs in preparation for restore modules @ 2023-02-15 22:48 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 13+ messages in thread From: Nathan Bossart @ 2023-02-15 22:48 UTC (permalink / raw) --- doc/src/sgml/archive-and-restore-modules.sgml | 226 ++++++++++-------- 1 file changed, 120 insertions(+), 106 deletions(-) diff --git a/doc/src/sgml/archive-and-restore-modules.sgml b/doc/src/sgml/archive-and-restore-modules.sgml index cf7438a759..a52d15082d 100644 --- a/doc/src/sgml/archive-and-restore-modules.sgml +++ b/doc/src/sgml/archive-and-restore-modules.sgml @@ -1,9 +1,9 @@ -<!-- doc/src/sgml/archive-modules.sgml --> +<!-- doc/src/sgml/archive-and-restore-modules.sgml --> -<chapter id="archive-modules"> - <title>Archive Modules</title> - <indexterm zone="archive-modules"> - <primary>Archive Modules</primary> +<chapter id="archive-and-restore-modules"> + <title>Archive and Restore Modules</title> + <indexterm zone="archive-and-restore-modules"> + <primary>Archive and Restore Modules</primary> </indexterm> <para> @@ -14,45 +14,52 @@ performant. </para> - <para> - When a custom <xref linkend="guc-archive-library"/> is configured, PostgreSQL - will submit completed WAL files to the module, and the server will avoid - recycling or removing these WAL files until the module indicates that the files - were successfully archived. It is ultimately up to the module to decide what - to do with each WAL file, but many recommendations are listed at - <xref linkend="backup-archiving-wal"/>. - </para> - - <para> - Archiving modules must at least consist of an initialization function (see - <xref linkend="archive-module-init"/>) and the required callbacks (see - <xref linkend="archive-module-callbacks"/>). However, archive modules are - also permitted to do much more (e.g., declare GUCs and register background - workers). - </para> - <para> The <filename>contrib/basic_archive</filename> module contains a working example, which demonstrates some useful techniques. </para> - <sect1 id="archive-module-init"> - <title>Initialization Functions</title> - <indexterm zone="archive-module-init"> - <primary>_PG_archive_module_init</primary> + <sect1 id="archive-modules"> + <title>Archive Modules</title> + <indexterm zone="archive-modules"> + <primary>Archive Modules</primary> </indexterm> + + <para> + When a custom <xref linkend="guc-archive-library"/> is configured, + PostgreSQL will submit completed WAL files to the module, and the server + will avoid recycling or removing these WAL files until the module indicates + that the files were successfully archived. It is ultimately up to the + module to decide what to do with each WAL file, but many recommendations are + listed at <xref linkend="backup-archiving-wal"/>. + </para> + <para> - An archive library is loaded by dynamically loading a shared library with the - <xref linkend="guc-archive-library"/>'s name as the library base name. The - normal library search path is used to locate the library. To provide the - required archive module callbacks and to indicate that the library is - actually an archive module, it needs to provide a function named - <function>_PG_archive_module_init</function>. The result of the function - must be a pointer to a struct of type - <structname>ArchiveModuleCallbacks</structname>, which contains everything - that the core code needs to know to make use of the archive module. The - return value needs to be of server lifetime, which is typically achieved by - defining it as a <literal>static const</literal> variable in global scope. + Archiving modules must at least consist of an initialization function (see + <xref linkend="archive-module-init"/>) and the required callbacks (see + <xref linkend="archive-module-callbacks"/>). However, archive modules are + also permitted to do much more (e.g., declare GUCs and register background + workers). + </para> + + <sect2 id="archive-module-init"> + <title>Initialization Functions</title> + <indexterm zone="archive-module-init"> + <primary>_PG_archive_module_init</primary> + </indexterm> + + <para> + An archive library is loaded by dynamically loading a shared library with + the <xref linkend="guc-archive-library"/>'s name as the library base name. + The normal library search path is used to locate the library. To provide + the required archive module callbacks and to indicate that the library is + actually an archive module, it needs to provide a function named + <function>_PG_archive_module_init</function>. The result of the function + must be a pointer to a struct of type + <structname>ArchiveModuleCallbacks</structname>, which contains everything + that the core code needs to know to make use of the archive module. The + return value needs to be of server lifetime, which is typically achieved by + defining it as a <literal>static const</literal> variable in global scope. <programlisting> typedef struct ArchiveModuleCallbacks @@ -65,103 +72,110 @@ typedef struct ArchiveModuleCallbacks typedef const ArchiveModuleCallbacks *(*ArchiveModuleInit) (void); </programlisting> - Only the <function>archive_file_cb</function> callback is required. The - others are optional. - </para> - </sect1> + Only the <function>archive_file_cb</function> callback is required. The + others are optional. + </para> + </sect2> - <sect1 id="archive-module-callbacks"> - <title>Archive Module Callbacks</title> - <para> - The archive callbacks define the actual archiving behavior of the module. - The server will call them as required to process each individual WAL file. - </para> + <sect2 id="archive-module-callbacks"> + <title>Archive Module Callbacks</title> - <sect2 id="archive-module-startup"> - <title>Startup Callback</title> <para> - The <function>startup_cb</function> callback is called shortly after the - module is loaded. This callback can be used to perform any additional - initialization required. If the archive module has any state, it can use - <structfield>state->private_data</structfield> to store it. + The archive callbacks define the actual archiving behavior of the module. + The server will call them as required to process each individual WAL file. + </para> + + <sect3 id="archive-module-startup"> + <title>Startup Callback</title> + + <para> + The <function>startup_cb</function> callback is called shortly after the + module is loaded. This callback can be used to perform any additional + initialization required. If the archive module has any state, it can use + <structfield>state->private_data</structfield> to store it. <programlisting> typedef void (*ArchiveStartupCB) (ArchiveModuleState *state); </programlisting> - </para> - </sect2> + </para> + </sect3> - <sect2 id="archive-module-check"> - <title>Check Callback</title> - <para> - The <function>check_configured_cb</function> callback is called to determine - whether the module is fully configured and ready to accept WAL files (e.g., - its configuration parameters are set to valid values). If no - <function>check_configured_cb</function> is defined, the server always - assumes the module is configured. + <sect3 id="archive-module-check"> + <title>Check Callback</title> + + <para> + The <function>check_configured_cb</function> callback is called to + determine whether the module is fully configured and ready to accept WAL + files (e.g., its configuration parameters are set to valid values). If no + <function>check_configured_cb</function> is defined, the server always + assumes the module is configured. <programlisting> typedef bool (*ArchiveCheckConfiguredCB) (ArchiveModuleState *state); </programlisting> - If <literal>true</literal> is returned, the server will proceed with - archiving the file by calling the <function>archive_file_cb</function> - callback. If <literal>false</literal> is returned, archiving will not - proceed, and the archiver will emit the following message to the server log: + If <literal>true</literal> is returned, the server will proceed with + archiving the file by calling the <function>archive_file_cb</function> + callback. If <literal>false</literal> is returned, archiving will not + proceed, and the archiver will emit the following message to the server + log: <screen> WARNING: archive_mode enabled, yet archiving is not configured </screen> - In the latter case, the server will periodically call this function, and - archiving will proceed only when it returns <literal>true</literal>. - </para> - - <note> - <para> - When returning <literal>false</literal>, it may be useful to append some - additional information to the generic warning message. To do that, provide - a message to the <function>arch_module_check_errdetail</function> macro - before returning <literal>false</literal>. Like - <function>errdetail()</function>, this macro accepts a format string - followed by an optional list of arguments. The resulting string will be - emitted as the <literal>DETAIL</literal> line of the warning message. + In the latter case, the server will periodically call this function, and + archiving will proceed only when it returns <literal>true</literal>. </para> - </note> - </sect2> - <sect2 id="archive-module-archive"> - <title>Archive Callback</title> - <para> - The <function>archive_file_cb</function> callback is called to archive a - single WAL file. + <note> + <para> + When returning <literal>false</literal>, it may be useful to append some + additional information to the generic warning message. To do that, + provide a message to the <function>arch_module_check_errdetail</function> + macro before returning <literal>false</literal>. Like + <function>errdetail()</function>, this macro accepts a format string + followed by an optional list of arguments. The resulting string will be + emitted as the <literal>DETAIL</literal> line of the warning message. + </para> + </note> + </sect3> + + <sect3 id="archive-module-archive"> + <title>Archive Callback</title> + + <para> + The <function>archive_file_cb</function> callback is called to archive a + single WAL file. <programlisting> typedef bool (*ArchiveFileCB) (ArchiveModuleState *state, const char *file, const char *path); </programlisting> - If <literal>true</literal> is returned, the server proceeds as if the file - was successfully archived, which may include recycling or removing the - original WAL file. If <literal>false</literal> is returned, the server will - keep the original WAL file and retry archiving later. - <replaceable>file</replaceable> will contain just the file name of the WAL - file to archive, while <replaceable>path</replaceable> contains the full - path of the WAL file (including the file name). - </para> - </sect2> + If <literal>true</literal> is returned, the server proceeds as if the file + was successfully archived, which may include recycling or removing the + original WAL file. If <literal>false</literal> is returned, the server + will keep the original WAL file and retry archiving later. + <replaceable>file</replaceable> will contain just the file name of the WAL + file to archive, while <replaceable>path</replaceable> contains the full + path of the WAL file (including the file name). + </para> + </sect3> - <sect2 id="archive-module-shutdown"> - <title>Shutdown Callback</title> - <para> - The <function>shutdown_cb</function> callback is called when the archiver - process exits (e.g., after an error) or the value of - <xref linkend="guc-archive-library"/> changes. If no - <function>shutdown_cb</function> is defined, no special action is taken in - these situations. If the archive module has any state, this callback should - free it to avoid leaks. + <sect3 id="archive-module-shutdown"> + <title>Shutdown Callback</title> + + <para> + The <function>shutdown_cb</function> callback is called when the archiver + process exits (e.g., after an error) or the value of + <xref linkend="guc-archive-library"/> changes. If no + <function>shutdown_cb</function> is defined, no special action is taken in + these situations. If the archive module has any state, this callback + should free it to avoid leaks. <programlisting> typedef void (*ArchiveShutdownCB) (ArchiveModuleState *state); </programlisting> - </para> + </para> + </sect3> </sect2> </sect1> </chapter> -- 2.25.1 --IJpNTDwzlM2Ie8A6 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v18-0005-introduce-restore_library.patch" ^ permalink raw reply [nested|flat] 13+ messages in thread
* [PATCH v21 4/5] restructure archive modules docs in preparation for restore modules @ 2023-02-15 22:48 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 13+ messages in thread From: Nathan Bossart @ 2023-02-15 22:48 UTC (permalink / raw) --- doc/src/sgml/archive-and-restore-modules.sgml | 242 +++++++++--------- 1 file changed, 128 insertions(+), 114 deletions(-) diff --git a/doc/src/sgml/archive-and-restore-modules.sgml b/doc/src/sgml/archive-and-restore-modules.sgml index 10ec96eae9..6e368290b9 100644 --- a/doc/src/sgml/archive-and-restore-modules.sgml +++ b/doc/src/sgml/archive-and-restore-modules.sgml @@ -1,9 +1,9 @@ -<!-- doc/src/sgml/archive-modules.sgml --> +<!-- doc/src/sgml/archive-and-restore-modules.sgml --> -<chapter id="archive-modules"> - <title>Archive Modules</title> - <indexterm zone="archive-modules"> - <primary>Archive Modules</primary> +<chapter id="archive-and-restore-modules"> + <title>Archive and Restore Modules</title> + <indexterm zone="archive-and-restore-modules"> + <primary>Archive and Restore Modules</primary> </indexterm> <para> @@ -14,45 +14,52 @@ performant. </para> - <para> - When a custom <xref linkend="guc-archive-library"/> is configured, PostgreSQL - will submit completed WAL files to the module, and the server will avoid - recycling or removing these WAL files until the module indicates that the files - were successfully archived. It is ultimately up to the module to decide what - to do with each WAL file, but many recommendations are listed at - <xref linkend="backup-archiving-wal"/>. - </para> - - <para> - Archiving modules must at least consist of an initialization function (see - <xref linkend="archive-module-init"/>) and the required callbacks (see - <xref linkend="archive-module-callbacks"/>). However, archive modules are - also permitted to do much more (e.g., declare GUCs and register background - workers). - </para> - <para> The <filename>contrib/basic_archive</filename> module contains a working example, which demonstrates some useful techniques. </para> - <sect1 id="archive-module-init"> - <title>Initialization Functions</title> - <indexterm zone="archive-module-init"> - <primary>_PG_archive_module_init</primary> + <sect1 id="archive-modules"> + <title>Archive Modules</title> + <indexterm zone="archive-modules"> + <primary>Archive Modules</primary> </indexterm> + + <para> + When a custom <xref linkend="guc-archive-library"/> is configured, + PostgreSQL will submit completed WAL files to the module, and the server + will avoid recycling or removing these WAL files until the module indicates + that the files were successfully archived. It is ultimately up to the + module to decide what to do with each WAL file, but many recommendations are + listed at <xref linkend="backup-archiving-wal"/>. + </para> + <para> - An archive library is loaded by dynamically loading a shared library with the - <xref linkend="guc-archive-library"/>'s name as the library base name. The - normal library search path is used to locate the library. To provide the - required archive module callbacks and to indicate that the library is - actually an archive module, it needs to provide a function named - <function>_PG_archive_module_init</function>. The result of the function - must be a pointer to a struct of type - <structname>ArchiveModuleCallbacks</structname>, which contains everything - that the core code needs to know to make use of the archive module. The - return value needs to be of server lifetime, which is typically achieved by - defining it as a <literal>static const</literal> variable in global scope. + Archiving modules must at least consist of an initialization function (see + <xref linkend="archive-module-init"/>) and the required callbacks (see + <xref linkend="archive-module-callbacks"/>). However, archive modules are + also permitted to do much more (e.g., declare GUCs and register background + workers). + </para> + + <sect2 id="archive-module-init"> + <title>Initialization Functions</title> + <indexterm zone="archive-module-init"> + <primary>_PG_archive_module_init</primary> + </indexterm> + + <para> + An archive library is loaded by dynamically loading a shared library with + the <xref linkend="guc-archive-library"/>'s name as the library base name. + The normal library search path is used to locate the library. To provide + the required archive module callbacks and to indicate that the library is + actually an archive module, it needs to provide a function named + <function>_PG_archive_module_init</function>. The result of the function + must be a pointer to a struct of type + <structname>ArchiveModuleCallbacks</structname>, which contains everything + that the core code needs to know to make use of the archive module. The + return value needs to be of server lifetime, which is typically achieved by + defining it as a <literal>static const</literal> variable in global scope. <programlisting> typedef struct ArchiveModuleCallbacks @@ -65,112 +72,119 @@ typedef struct ArchiveModuleCallbacks typedef const ArchiveModuleCallbacks *(*ArchiveModuleInit) (void); </programlisting> - Only the <function>archive_file_cb</function> callback is required. The - others are optional. - </para> - </sect1> + Only the <function>archive_file_cb</function> callback is required. The + others are optional. + </para> + </sect2> - <sect1 id="archive-module-callbacks"> - <title>Archive Module Callbacks</title> - <para> - The archive callbacks define the actual archiving behavior of the module. - The server will call them as required to process each individual WAL file. - </para> + <sect2 id="archive-module-callbacks"> + <title>Archive Module Callbacks</title> - <sect2 id="archive-module-startup"> - <title>Startup Callback</title> <para> - The <function>startup_cb</function> callback is called shortly after the - module is loaded. This callback can be used to perform any additional - initialization required. If the archive module has any state, it can use - <structfield>state->private_data</structfield> to store it. + The archive callbacks define the actual archiving behavior of the module. + The server will call them as required to process each individual WAL file. + </para> + + <sect3 id="archive-module-startup"> + <title>Startup Callback</title> + + <para> + The <function>startup_cb</function> callback is called shortly after the + module is loaded. This callback can be used to perform any additional + initialization required. If the archive module has any state, it can use + <structfield>state->private_data</structfield> to store it. <programlisting> typedef void (*ArchiveStartupCB) (ArchiveModuleState *state); </programlisting> - </para> - </sect2> + </para> + </sect3> - <sect2 id="archive-module-check"> - <title>Check Callback</title> - <para> - The <function>check_configured_cb</function> callback is called to determine - whether the module is fully configured and ready to accept WAL files (e.g., - its configuration parameters are set to valid values). If no - <function>check_configured_cb</function> is defined, the server always - assumes the module is configured. + <sect3 id="archive-module-check"> + <title>Check Callback</title> + + <para> + The <function>check_configured_cb</function> callback is called to + determine whether the module is fully configured and ready to accept WAL + files (e.g., its configuration parameters are set to valid values). If no + <function>check_configured_cb</function> is defined, the server always + assumes the module is configured. <programlisting> typedef bool (*ArchiveCheckConfiguredCB) (ArchiveModuleState *state); </programlisting> - If <literal>true</literal> is returned, the server will proceed with - archiving the file by calling the <function>archive_file_cb</function> - callback. If <literal>false</literal> is returned, archiving will not - proceed, and the archiver will emit the following message to the server log: + If <literal>true</literal> is returned, the server will proceed with + archiving the file by calling the <function>archive_file_cb</function> + callback. If <literal>false</literal> is returned, archiving will not + proceed, and the archiver will emit the following message to the server + log: <screen> WARNING: archive_mode enabled, yet archiving is not configured </screen> - In the latter case, the server will periodically call this function, and - archiving will proceed only when it returns <literal>true</literal>. - </para> - - <note> - <para> - When returning <literal>false</literal>, it may be useful to append some - additional information to the generic warning message. To do that, provide - a message to the <function>arch_module_check_errdetail</function> macro - before returning <literal>false</literal>. Like - <function>errdetail()</function>, this macro accepts a format string - followed by an optional list of arguments. The resulting string will be - emitted as the <literal>DETAIL</literal> line of the warning message. + In the latter case, the server will periodically call this function, and + archiving will proceed only when it returns <literal>true</literal>. </para> - </note> - </sect2> - <sect2 id="archive-module-archive"> - <title>Archive Callback</title> - <para> - The <function>archive_file_cb</function> callback is called to archive a - single WAL file. + <note> + <para> + When returning <literal>false</literal>, it may be useful to append some + additional information to the generic warning message. To do that, + provide a message to the <function>arch_module_check_errdetail</function> + macro before returning <literal>false</literal>. Like + <function>errdetail()</function>, this macro accepts a format string + followed by an optional list of arguments. The resulting string will be + emitted as the <literal>DETAIL</literal> line of the warning message. + </para> + </note> + </sect3> + + <sect3 id="archive-module-archive"> + <title>Archive Callback</title> + + <para> + The <function>archive_file_cb</function> callback is called to archive a + single WAL file. <programlisting> typedef bool (*ArchiveFileCB) (ArchiveModuleState *state, const char *file, const char *path); </programlisting> - If <literal>true</literal> is returned, the server proceeds as if the file - was successfully archived, which may include recycling or removing the - original WAL file. If <literal>false</literal> is returned or an error is thrown, the server will - keep the original WAL file and retry archiving later. - <replaceable>file</replaceable> will contain just the file name of the WAL - file to archive, while <replaceable>path</replaceable> contains the full - path of the WAL file (including the file name). - </para> - - <note> - <para> - The <function>archive_file_cb</function> callback is called in a - short-lived memory context that will be reset between invocations. If you - need longer-lived storage, create a memory context in the module's - <function>startup_cb</function> callback. + If <literal>true</literal> is returned, the server proceeds as if the file + was successfully archived, which may include recycling or removing the + original WAL file. If <literal>false</literal> is returned or an error is + thrown, the server will keep the original WAL file and retry archiving + later. <replaceable>file</replaceable> will contain just the file name of + the WAL file to archive, while <replaceable>path</replaceable> contains the + full path of the WAL file (including the file name). </para> - </note> - </sect2> - <sect2 id="archive-module-shutdown"> - <title>Shutdown Callback</title> - <para> - The <function>shutdown_cb</function> callback is called when the archiver - process exits (e.g., after an error) or the value of - <xref linkend="guc-archive-library"/> changes. If no - <function>shutdown_cb</function> is defined, no special action is taken in - these situations. If the archive module has any state, this callback should - free it to avoid leaks. + <note> + <para> + The <function>archive_file_cb</function> callback is called in a + short-lived memory context that will be reset between invocations. If you + need longer-lived storage, create a memory context in the module's + <function>startup_cb</function> callback. + </para> + </note> + </sect3> + + <sect3 id="archive-module-shutdown"> + <title>Shutdown Callback</title> + + <para> + The <function>shutdown_cb</function> callback is called when the archiver + process exits (e.g., after an error) or the value of + <xref linkend="guc-archive-library"/> changes. If no + <function>shutdown_cb</function> is defined, no special action is taken in + these situations. If the archive module has any state, this callback + should free it to avoid leaks. <programlisting> typedef void (*ArchiveShutdownCB) (ArchiveModuleState *state); </programlisting> - </para> + </para> + </sect3> </sect2> </sect1> </chapter> -- 2.25.1 --PNTmBPCT7hxwcZjr Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v21-0005-introduce-restore_library.patch" ^ permalink raw reply [nested|flat] 13+ messages in thread
* [PATCH v17 4/5] restructure archive modules docs in preparation for restore modules @ 2023-02-15 22:48 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 13+ messages in thread From: Nathan Bossart @ 2023-02-15 22:48 UTC (permalink / raw) --- doc/src/sgml/archive-and-restore-modules.sgml | 206 ++++++++++-------- 1 file changed, 110 insertions(+), 96 deletions(-) diff --git a/doc/src/sgml/archive-and-restore-modules.sgml b/doc/src/sgml/archive-and-restore-modules.sgml index 7064307d9e..7ed50a3b52 100644 --- a/doc/src/sgml/archive-and-restore-modules.sgml +++ b/doc/src/sgml/archive-and-restore-modules.sgml @@ -1,9 +1,9 @@ -<!-- doc/src/sgml/archive-modules.sgml --> +<!-- doc/src/sgml/archive-and-restore-modules.sgml --> -<chapter id="archive-modules"> - <title>Archive Modules</title> - <indexterm zone="archive-modules"> - <primary>Archive Modules</primary> +<chapter id="archive-and-restore-modules"> + <title>Archive and Restore Modules</title> + <indexterm zone="archive-and-restore-modules"> + <primary>Archive and Restore Modules</primary> </indexterm> <para> @@ -14,45 +14,52 @@ performant. </para> - <para> - When a custom <xref linkend="guc-archive-library"/> is configured, PostgreSQL - will submit completed WAL files to the module, and the server will avoid - recycling or removing these WAL files until the module indicates that the files - were successfully archived. It is ultimately up to the module to decide what - to do with each WAL file, but many recommendations are listed at - <xref linkend="backup-archiving-wal"/>. - </para> - - <para> - Archiving modules must at least consist of an initialization function (see - <xref linkend="archive-module-init"/>) and the required callbacks (see - <xref linkend="archive-module-callbacks"/>). However, archive modules are - also permitted to do much more (e.g., declare GUCs and register background - workers). - </para> - <para> The <filename>contrib/basic_archive</filename> module contains a working example, which demonstrates some useful techniques. </para> - <sect1 id="archive-module-init"> - <title>Initialization Functions</title> - <indexterm zone="archive-module-init"> - <primary>_PG_archive_module_init</primary> + <sect1 id="archive-modules"> + <title>Archive Modules</title> + <indexterm zone="archive-modules"> + <primary>Archive Modules</primary> </indexterm> + + <para> + When a custom <xref linkend="guc-archive-library"/> is configured, + PostgreSQL will submit completed WAL files to the module, and the server + will avoid recycling or removing these WAL files until the module indicates + that the files were successfully archived. It is ultimately up to the + module to decide what to do with each WAL file, but many recommendations are + listed at <xref linkend="backup-archiving-wal"/>. + </para> + <para> - An archive library is loaded by dynamically loading a shared library with the - <xref linkend="guc-archive-library"/>'s name as the library base name. The - normal library search path is used to locate the library. To provide the - required archive module callbacks and to indicate that the library is - actually an archive module, it needs to provide a function named - <function>_PG_archive_module_init</function>. The result of the function - must be a pointer to a struct of type - <structname>ArchiveModuleCallbacks</structname>, which contains everything - that the core code needs to know to make use of the archive module. The - return value needs to be of server lifetime, which is typically achieved by - defining it as a <literal>static const</literal> variable in global scope. + Archiving modules must at least consist of an initialization function (see + <xref linkend="archive-module-init"/>) and the required callbacks (see + <xref linkend="archive-module-callbacks"/>). However, archive modules are + also permitted to do much more (e.g., declare GUCs and register background + workers). + </para> + + <sect2 id="archive-module-init"> + <title>Initialization Functions</title> + <indexterm zone="archive-module-init"> + <primary>_PG_archive_module_init</primary> + </indexterm> + + <para> + An archive library is loaded by dynamically loading a shared library with + the <xref linkend="guc-archive-library"/>'s name as the library base name. + The normal library search path is used to locate the library. To provide + the required archive module callbacks and to indicate that the library is + actually an archive module, it needs to provide a function named + <function>_PG_archive_module_init</function>. The result of the function + must be a pointer to a struct of type + <structname>ArchiveModuleCallbacks</structname>, which contains everything + that the core code needs to know to make use of the archive module. The + return value needs to be of server lifetime, which is typically achieved by + defining it as a <literal>static const</literal> variable in global scope. <programlisting> typedef struct ArchiveModuleCallbacks @@ -65,91 +72,98 @@ typedef struct ArchiveModuleCallbacks typedef const ArchiveModuleCallbacks *(*ArchiveModuleInit) (void); </programlisting> - Only the <function>archive_file_cb</function> callback is required. The - others are optional. - </para> - </sect1> + Only the <function>archive_file_cb</function> callback is required. The + others are optional. + </para> + </sect2> - <sect1 id="archive-module-callbacks"> - <title>Archive Module Callbacks</title> - <para> - The archive callbacks define the actual archiving behavior of the module. - The server will call them as required to process each individual WAL file. - </para> + <sect2 id="archive-module-callbacks"> + <title>Archive Module Callbacks</title> - <sect2 id="archive-module-startup"> - <title>Startup Callback</title> <para> - The <function>startup_cb</function> callback is called shortly after the - module is loaded. This callback can be used to perform any additional - initialization required. If the archive module has any state, it can use - <structfield>state->private_data</structfield> to store it. + The archive callbacks define the actual archiving behavior of the module. + The server will call them as required to process each individual WAL file. + </para> + + <sect3 id="archive-module-startup"> + <title>Startup Callback</title> + + <para> + The <function>startup_cb</function> callback is called shortly after the + module is loaded. This callback can be used to perform any additional + initialization required. If the archive module has any state, it can use + <structfield>state->private_data</structfield> to store it. <programlisting> typedef void (*ArchiveStartupCB) (ArchiveModuleState *state); </programlisting> - </para> - </sect2> + </para> + </sect3> - <sect2 id="archive-module-check"> - <title>Check Callback</title> - <para> - The <function>check_configured_cb</function> callback is called to determine - whether the module is fully configured and ready to accept WAL files (e.g., - its configuration parameters are set to valid values). If no - <function>check_configured_cb</function> is defined, the server always - assumes the module is configured. + <sect3 id="archive-module-check"> + <title>Check Callback</title> + + <para> + The <function>check_configured_cb</function> callback is called to + determine whether the module is fully configured and ready to accept WAL + files (e.g., its configuration parameters are set to valid values). If no + <function>check_configured_cb</function> is defined, the server always + assumes the module is configured. <programlisting> typedef bool (*ArchiveCheckConfiguredCB) (ArchiveModuleState *state); </programlisting> - If <literal>true</literal> is returned, the server will proceed with - archiving the file by calling the <function>archive_file_cb</function> - callback. If <literal>false</literal> is returned, archiving will not - proceed, and the archiver will emit the following message to the server log: + If <literal>true</literal> is returned, the server will proceed with + archiving the file by calling the <function>archive_file_cb</function> + callback. If <literal>false</literal> is returned, archiving will not + proceed, and the archiver will emit the following message to the server + log: <screen> WARNING: archive_mode enabled, yet archiving is not configured </screen> - In the latter case, the server will periodically call this function, and - archiving will proceed only when it returns <literal>true</literal>. - </para> - </sect2> + In the latter case, the server will periodically call this function, and + archiving will proceed only when it returns <literal>true</literal>. + </para> + </sect3> - <sect2 id="archive-module-archive"> - <title>Archive Callback</title> - <para> - The <function>archive_file_cb</function> callback is called to archive a - single WAL file. + <sect3 id="archive-module-archive"> + <title>Archive Callback</title> + + <para> + The <function>archive_file_cb</function> callback is called to archive a + single WAL file. <programlisting> typedef bool (*ArchiveFileCB) (ArchiveModuleState *state, const char *file, const char *path); </programlisting> - If <literal>true</literal> is returned, the server proceeds as if the file - was successfully archived, which may include recycling or removing the - original WAL file. If <literal>false</literal> is returned, the server will - keep the original WAL file and retry archiving later. - <replaceable>file</replaceable> will contain just the file name of the WAL - file to archive, while <replaceable>path</replaceable> contains the full - path of the WAL file (including the file name). - </para> - </sect2> - - <sect2 id="archive-module-shutdown"> - <title>Shutdown Callback</title> - <para> - The <function>shutdown_cb</function> callback is called when the archiver - process exits (e.g., after an error) or the value of - <xref linkend="guc-archive-library"/> changes. If no - <function>shutdown_cb</function> is defined, no special action is taken in - these situations. If the archive module has any state, this callback should - free it to avoid leaks. + If <literal>true</literal> is returned, the server proceeds as if the file + was successfully archived, which may include recycling or removing the + original WAL file. If <literal>false</literal> is returned, the server + will keep the original WAL file and retry archiving later. + <replaceable>file</replaceable> will contain just the file name of the WAL + file to archive, while <replaceable>path</replaceable> contains the full + path of the WAL file (including the file name). + </para> + </sect3> + + <sect3 id="archive-module-shutdown"> + <title>Shutdown Callback</title> + + <para> + The <function>shutdown_cb</function> callback is called when the archiver + process exits (e.g., after an error) or the value of + <xref linkend="guc-archive-library"/> changes. If no + <function>shutdown_cb</function> is defined, no special action is taken in + these situations. If the archive module has any state, this callback + should free it to avoid leaks. <programlisting> typedef void (*ArchiveShutdownCB) (ArchiveModuleState *state); </programlisting> - </para> + </para> + </sect3> </sect2> </sect1> </chapter> -- 2.25.1 --cNdxnHkX5QqsyA0e Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v17-0005-introduce-restore_library.patch" ^ permalink raw reply [nested|flat] 13+ messages in thread
* [PATCH v19 4/5] restructure archive modules docs in preparation for restore modules @ 2023-02-15 22:48 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 13+ messages in thread From: Nathan Bossart @ 2023-02-15 22:48 UTC (permalink / raw) --- doc/src/sgml/archive-and-restore-modules.sgml | 226 ++++++++++-------- 1 file changed, 120 insertions(+), 106 deletions(-) diff --git a/doc/src/sgml/archive-and-restore-modules.sgml b/doc/src/sgml/archive-and-restore-modules.sgml index cf7438a759..a52d15082d 100644 --- a/doc/src/sgml/archive-and-restore-modules.sgml +++ b/doc/src/sgml/archive-and-restore-modules.sgml @@ -1,9 +1,9 @@ -<!-- doc/src/sgml/archive-modules.sgml --> +<!-- doc/src/sgml/archive-and-restore-modules.sgml --> -<chapter id="archive-modules"> - <title>Archive Modules</title> - <indexterm zone="archive-modules"> - <primary>Archive Modules</primary> +<chapter id="archive-and-restore-modules"> + <title>Archive and Restore Modules</title> + <indexterm zone="archive-and-restore-modules"> + <primary>Archive and Restore Modules</primary> </indexterm> <para> @@ -14,45 +14,52 @@ performant. </para> - <para> - When a custom <xref linkend="guc-archive-library"/> is configured, PostgreSQL - will submit completed WAL files to the module, and the server will avoid - recycling or removing these WAL files until the module indicates that the files - were successfully archived. It is ultimately up to the module to decide what - to do with each WAL file, but many recommendations are listed at - <xref linkend="backup-archiving-wal"/>. - </para> - - <para> - Archiving modules must at least consist of an initialization function (see - <xref linkend="archive-module-init"/>) and the required callbacks (see - <xref linkend="archive-module-callbacks"/>). However, archive modules are - also permitted to do much more (e.g., declare GUCs and register background - workers). - </para> - <para> The <filename>contrib/basic_archive</filename> module contains a working example, which demonstrates some useful techniques. </para> - <sect1 id="archive-module-init"> - <title>Initialization Functions</title> - <indexterm zone="archive-module-init"> - <primary>_PG_archive_module_init</primary> + <sect1 id="archive-modules"> + <title>Archive Modules</title> + <indexterm zone="archive-modules"> + <primary>Archive Modules</primary> </indexterm> + + <para> + When a custom <xref linkend="guc-archive-library"/> is configured, + PostgreSQL will submit completed WAL files to the module, and the server + will avoid recycling or removing these WAL files until the module indicates + that the files were successfully archived. It is ultimately up to the + module to decide what to do with each WAL file, but many recommendations are + listed at <xref linkend="backup-archiving-wal"/>. + </para> + <para> - An archive library is loaded by dynamically loading a shared library with the - <xref linkend="guc-archive-library"/>'s name as the library base name. The - normal library search path is used to locate the library. To provide the - required archive module callbacks and to indicate that the library is - actually an archive module, it needs to provide a function named - <function>_PG_archive_module_init</function>. The result of the function - must be a pointer to a struct of type - <structname>ArchiveModuleCallbacks</structname>, which contains everything - that the core code needs to know to make use of the archive module. The - return value needs to be of server lifetime, which is typically achieved by - defining it as a <literal>static const</literal> variable in global scope. + Archiving modules must at least consist of an initialization function (see + <xref linkend="archive-module-init"/>) and the required callbacks (see + <xref linkend="archive-module-callbacks"/>). However, archive modules are + also permitted to do much more (e.g., declare GUCs and register background + workers). + </para> + + <sect2 id="archive-module-init"> + <title>Initialization Functions</title> + <indexterm zone="archive-module-init"> + <primary>_PG_archive_module_init</primary> + </indexterm> + + <para> + An archive library is loaded by dynamically loading a shared library with + the <xref linkend="guc-archive-library"/>'s name as the library base name. + The normal library search path is used to locate the library. To provide + the required archive module callbacks and to indicate that the library is + actually an archive module, it needs to provide a function named + <function>_PG_archive_module_init</function>. The result of the function + must be a pointer to a struct of type + <structname>ArchiveModuleCallbacks</structname>, which contains everything + that the core code needs to know to make use of the archive module. The + return value needs to be of server lifetime, which is typically achieved by + defining it as a <literal>static const</literal> variable in global scope. <programlisting> typedef struct ArchiveModuleCallbacks @@ -65,103 +72,110 @@ typedef struct ArchiveModuleCallbacks typedef const ArchiveModuleCallbacks *(*ArchiveModuleInit) (void); </programlisting> - Only the <function>archive_file_cb</function> callback is required. The - others are optional. - </para> - </sect1> + Only the <function>archive_file_cb</function> callback is required. The + others are optional. + </para> + </sect2> - <sect1 id="archive-module-callbacks"> - <title>Archive Module Callbacks</title> - <para> - The archive callbacks define the actual archiving behavior of the module. - The server will call them as required to process each individual WAL file. - </para> + <sect2 id="archive-module-callbacks"> + <title>Archive Module Callbacks</title> - <sect2 id="archive-module-startup"> - <title>Startup Callback</title> <para> - The <function>startup_cb</function> callback is called shortly after the - module is loaded. This callback can be used to perform any additional - initialization required. If the archive module has any state, it can use - <structfield>state->private_data</structfield> to store it. + The archive callbacks define the actual archiving behavior of the module. + The server will call them as required to process each individual WAL file. + </para> + + <sect3 id="archive-module-startup"> + <title>Startup Callback</title> + + <para> + The <function>startup_cb</function> callback is called shortly after the + module is loaded. This callback can be used to perform any additional + initialization required. If the archive module has any state, it can use + <structfield>state->private_data</structfield> to store it. <programlisting> typedef void (*ArchiveStartupCB) (ArchiveModuleState *state); </programlisting> - </para> - </sect2> + </para> + </sect3> - <sect2 id="archive-module-check"> - <title>Check Callback</title> - <para> - The <function>check_configured_cb</function> callback is called to determine - whether the module is fully configured and ready to accept WAL files (e.g., - its configuration parameters are set to valid values). If no - <function>check_configured_cb</function> is defined, the server always - assumes the module is configured. + <sect3 id="archive-module-check"> + <title>Check Callback</title> + + <para> + The <function>check_configured_cb</function> callback is called to + determine whether the module is fully configured and ready to accept WAL + files (e.g., its configuration parameters are set to valid values). If no + <function>check_configured_cb</function> is defined, the server always + assumes the module is configured. <programlisting> typedef bool (*ArchiveCheckConfiguredCB) (ArchiveModuleState *state); </programlisting> - If <literal>true</literal> is returned, the server will proceed with - archiving the file by calling the <function>archive_file_cb</function> - callback. If <literal>false</literal> is returned, archiving will not - proceed, and the archiver will emit the following message to the server log: + If <literal>true</literal> is returned, the server will proceed with + archiving the file by calling the <function>archive_file_cb</function> + callback. If <literal>false</literal> is returned, archiving will not + proceed, and the archiver will emit the following message to the server + log: <screen> WARNING: archive_mode enabled, yet archiving is not configured </screen> - In the latter case, the server will periodically call this function, and - archiving will proceed only when it returns <literal>true</literal>. - </para> - - <note> - <para> - When returning <literal>false</literal>, it may be useful to append some - additional information to the generic warning message. To do that, provide - a message to the <function>arch_module_check_errdetail</function> macro - before returning <literal>false</literal>. Like - <function>errdetail()</function>, this macro accepts a format string - followed by an optional list of arguments. The resulting string will be - emitted as the <literal>DETAIL</literal> line of the warning message. + In the latter case, the server will periodically call this function, and + archiving will proceed only when it returns <literal>true</literal>. </para> - </note> - </sect2> - <sect2 id="archive-module-archive"> - <title>Archive Callback</title> - <para> - The <function>archive_file_cb</function> callback is called to archive a - single WAL file. + <note> + <para> + When returning <literal>false</literal>, it may be useful to append some + additional information to the generic warning message. To do that, + provide a message to the <function>arch_module_check_errdetail</function> + macro before returning <literal>false</literal>. Like + <function>errdetail()</function>, this macro accepts a format string + followed by an optional list of arguments. The resulting string will be + emitted as the <literal>DETAIL</literal> line of the warning message. + </para> + </note> + </sect3> + + <sect3 id="archive-module-archive"> + <title>Archive Callback</title> + + <para> + The <function>archive_file_cb</function> callback is called to archive a + single WAL file. <programlisting> typedef bool (*ArchiveFileCB) (ArchiveModuleState *state, const char *file, const char *path); </programlisting> - If <literal>true</literal> is returned, the server proceeds as if the file - was successfully archived, which may include recycling or removing the - original WAL file. If <literal>false</literal> is returned, the server will - keep the original WAL file and retry archiving later. - <replaceable>file</replaceable> will contain just the file name of the WAL - file to archive, while <replaceable>path</replaceable> contains the full - path of the WAL file (including the file name). - </para> - </sect2> + If <literal>true</literal> is returned, the server proceeds as if the file + was successfully archived, which may include recycling or removing the + original WAL file. If <literal>false</literal> is returned, the server + will keep the original WAL file and retry archiving later. + <replaceable>file</replaceable> will contain just the file name of the WAL + file to archive, while <replaceable>path</replaceable> contains the full + path of the WAL file (including the file name). + </para> + </sect3> - <sect2 id="archive-module-shutdown"> - <title>Shutdown Callback</title> - <para> - The <function>shutdown_cb</function> callback is called when the archiver - process exits (e.g., after an error) or the value of - <xref linkend="guc-archive-library"/> changes. If no - <function>shutdown_cb</function> is defined, no special action is taken in - these situations. If the archive module has any state, this callback should - free it to avoid leaks. + <sect3 id="archive-module-shutdown"> + <title>Shutdown Callback</title> + + <para> + The <function>shutdown_cb</function> callback is called when the archiver + process exits (e.g., after an error) or the value of + <xref linkend="guc-archive-library"/> changes. If no + <function>shutdown_cb</function> is defined, no special action is taken in + these situations. If the archive module has any state, this callback + should free it to avoid leaks. <programlisting> typedef void (*ArchiveShutdownCB) (ArchiveModuleState *state); </programlisting> - </para> + </para> + </sect3> </sect2> </sect1> </chapter> -- 2.25.1 --oyUTqETQ0mS9luUI Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v19-0005-introduce-restore_library.patch" ^ permalink raw reply [nested|flat] 13+ messages in thread
* [PATCH v20 4/5] restructure archive modules docs in preparation for restore modules @ 2023-02-15 22:48 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 13+ messages in thread From: Nathan Bossart @ 2023-02-15 22:48 UTC (permalink / raw) --- doc/src/sgml/archive-and-restore-modules.sgml | 226 ++++++++++-------- 1 file changed, 120 insertions(+), 106 deletions(-) diff --git a/doc/src/sgml/archive-and-restore-modules.sgml b/doc/src/sgml/archive-and-restore-modules.sgml index cf7438a759..a52d15082d 100644 --- a/doc/src/sgml/archive-and-restore-modules.sgml +++ b/doc/src/sgml/archive-and-restore-modules.sgml @@ -1,9 +1,9 @@ -<!-- doc/src/sgml/archive-modules.sgml --> +<!-- doc/src/sgml/archive-and-restore-modules.sgml --> -<chapter id="archive-modules"> - <title>Archive Modules</title> - <indexterm zone="archive-modules"> - <primary>Archive Modules</primary> +<chapter id="archive-and-restore-modules"> + <title>Archive and Restore Modules</title> + <indexterm zone="archive-and-restore-modules"> + <primary>Archive and Restore Modules</primary> </indexterm> <para> @@ -14,45 +14,52 @@ performant. </para> - <para> - When a custom <xref linkend="guc-archive-library"/> is configured, PostgreSQL - will submit completed WAL files to the module, and the server will avoid - recycling or removing these WAL files until the module indicates that the files - were successfully archived. It is ultimately up to the module to decide what - to do with each WAL file, but many recommendations are listed at - <xref linkend="backup-archiving-wal"/>. - </para> - - <para> - Archiving modules must at least consist of an initialization function (see - <xref linkend="archive-module-init"/>) and the required callbacks (see - <xref linkend="archive-module-callbacks"/>). However, archive modules are - also permitted to do much more (e.g., declare GUCs and register background - workers). - </para> - <para> The <filename>contrib/basic_archive</filename> module contains a working example, which demonstrates some useful techniques. </para> - <sect1 id="archive-module-init"> - <title>Initialization Functions</title> - <indexterm zone="archive-module-init"> - <primary>_PG_archive_module_init</primary> + <sect1 id="archive-modules"> + <title>Archive Modules</title> + <indexterm zone="archive-modules"> + <primary>Archive Modules</primary> </indexterm> + + <para> + When a custom <xref linkend="guc-archive-library"/> is configured, + PostgreSQL will submit completed WAL files to the module, and the server + will avoid recycling or removing these WAL files until the module indicates + that the files were successfully archived. It is ultimately up to the + module to decide what to do with each WAL file, but many recommendations are + listed at <xref linkend="backup-archiving-wal"/>. + </para> + <para> - An archive library is loaded by dynamically loading a shared library with the - <xref linkend="guc-archive-library"/>'s name as the library base name. The - normal library search path is used to locate the library. To provide the - required archive module callbacks and to indicate that the library is - actually an archive module, it needs to provide a function named - <function>_PG_archive_module_init</function>. The result of the function - must be a pointer to a struct of type - <structname>ArchiveModuleCallbacks</structname>, which contains everything - that the core code needs to know to make use of the archive module. The - return value needs to be of server lifetime, which is typically achieved by - defining it as a <literal>static const</literal> variable in global scope. + Archiving modules must at least consist of an initialization function (see + <xref linkend="archive-module-init"/>) and the required callbacks (see + <xref linkend="archive-module-callbacks"/>). However, archive modules are + also permitted to do much more (e.g., declare GUCs and register background + workers). + </para> + + <sect2 id="archive-module-init"> + <title>Initialization Functions</title> + <indexterm zone="archive-module-init"> + <primary>_PG_archive_module_init</primary> + </indexterm> + + <para> + An archive library is loaded by dynamically loading a shared library with + the <xref linkend="guc-archive-library"/>'s name as the library base name. + The normal library search path is used to locate the library. To provide + the required archive module callbacks and to indicate that the library is + actually an archive module, it needs to provide a function named + <function>_PG_archive_module_init</function>. The result of the function + must be a pointer to a struct of type + <structname>ArchiveModuleCallbacks</structname>, which contains everything + that the core code needs to know to make use of the archive module. The + return value needs to be of server lifetime, which is typically achieved by + defining it as a <literal>static const</literal> variable in global scope. <programlisting> typedef struct ArchiveModuleCallbacks @@ -65,103 +72,110 @@ typedef struct ArchiveModuleCallbacks typedef const ArchiveModuleCallbacks *(*ArchiveModuleInit) (void); </programlisting> - Only the <function>archive_file_cb</function> callback is required. The - others are optional. - </para> - </sect1> + Only the <function>archive_file_cb</function> callback is required. The + others are optional. + </para> + </sect2> - <sect1 id="archive-module-callbacks"> - <title>Archive Module Callbacks</title> - <para> - The archive callbacks define the actual archiving behavior of the module. - The server will call them as required to process each individual WAL file. - </para> + <sect2 id="archive-module-callbacks"> + <title>Archive Module Callbacks</title> - <sect2 id="archive-module-startup"> - <title>Startup Callback</title> <para> - The <function>startup_cb</function> callback is called shortly after the - module is loaded. This callback can be used to perform any additional - initialization required. If the archive module has any state, it can use - <structfield>state->private_data</structfield> to store it. + The archive callbacks define the actual archiving behavior of the module. + The server will call them as required to process each individual WAL file. + </para> + + <sect3 id="archive-module-startup"> + <title>Startup Callback</title> + + <para> + The <function>startup_cb</function> callback is called shortly after the + module is loaded. This callback can be used to perform any additional + initialization required. If the archive module has any state, it can use + <structfield>state->private_data</structfield> to store it. <programlisting> typedef void (*ArchiveStartupCB) (ArchiveModuleState *state); </programlisting> - </para> - </sect2> + </para> + </sect3> - <sect2 id="archive-module-check"> - <title>Check Callback</title> - <para> - The <function>check_configured_cb</function> callback is called to determine - whether the module is fully configured and ready to accept WAL files (e.g., - its configuration parameters are set to valid values). If no - <function>check_configured_cb</function> is defined, the server always - assumes the module is configured. + <sect3 id="archive-module-check"> + <title>Check Callback</title> + + <para> + The <function>check_configured_cb</function> callback is called to + determine whether the module is fully configured and ready to accept WAL + files (e.g., its configuration parameters are set to valid values). If no + <function>check_configured_cb</function> is defined, the server always + assumes the module is configured. <programlisting> typedef bool (*ArchiveCheckConfiguredCB) (ArchiveModuleState *state); </programlisting> - If <literal>true</literal> is returned, the server will proceed with - archiving the file by calling the <function>archive_file_cb</function> - callback. If <literal>false</literal> is returned, archiving will not - proceed, and the archiver will emit the following message to the server log: + If <literal>true</literal> is returned, the server will proceed with + archiving the file by calling the <function>archive_file_cb</function> + callback. If <literal>false</literal> is returned, archiving will not + proceed, and the archiver will emit the following message to the server + log: <screen> WARNING: archive_mode enabled, yet archiving is not configured </screen> - In the latter case, the server will periodically call this function, and - archiving will proceed only when it returns <literal>true</literal>. - </para> - - <note> - <para> - When returning <literal>false</literal>, it may be useful to append some - additional information to the generic warning message. To do that, provide - a message to the <function>arch_module_check_errdetail</function> macro - before returning <literal>false</literal>. Like - <function>errdetail()</function>, this macro accepts a format string - followed by an optional list of arguments. The resulting string will be - emitted as the <literal>DETAIL</literal> line of the warning message. + In the latter case, the server will periodically call this function, and + archiving will proceed only when it returns <literal>true</literal>. </para> - </note> - </sect2> - <sect2 id="archive-module-archive"> - <title>Archive Callback</title> - <para> - The <function>archive_file_cb</function> callback is called to archive a - single WAL file. + <note> + <para> + When returning <literal>false</literal>, it may be useful to append some + additional information to the generic warning message. To do that, + provide a message to the <function>arch_module_check_errdetail</function> + macro before returning <literal>false</literal>. Like + <function>errdetail()</function>, this macro accepts a format string + followed by an optional list of arguments. The resulting string will be + emitted as the <literal>DETAIL</literal> line of the warning message. + </para> + </note> + </sect3> + + <sect3 id="archive-module-archive"> + <title>Archive Callback</title> + + <para> + The <function>archive_file_cb</function> callback is called to archive a + single WAL file. <programlisting> typedef bool (*ArchiveFileCB) (ArchiveModuleState *state, const char *file, const char *path); </programlisting> - If <literal>true</literal> is returned, the server proceeds as if the file - was successfully archived, which may include recycling or removing the - original WAL file. If <literal>false</literal> is returned, the server will - keep the original WAL file and retry archiving later. - <replaceable>file</replaceable> will contain just the file name of the WAL - file to archive, while <replaceable>path</replaceable> contains the full - path of the WAL file (including the file name). - </para> - </sect2> + If <literal>true</literal> is returned, the server proceeds as if the file + was successfully archived, which may include recycling or removing the + original WAL file. If <literal>false</literal> is returned, the server + will keep the original WAL file and retry archiving later. + <replaceable>file</replaceable> will contain just the file name of the WAL + file to archive, while <replaceable>path</replaceable> contains the full + path of the WAL file (including the file name). + </para> + </sect3> - <sect2 id="archive-module-shutdown"> - <title>Shutdown Callback</title> - <para> - The <function>shutdown_cb</function> callback is called when the archiver - process exits (e.g., after an error) or the value of - <xref linkend="guc-archive-library"/> changes. If no - <function>shutdown_cb</function> is defined, no special action is taken in - these situations. If the archive module has any state, this callback should - free it to avoid leaks. + <sect3 id="archive-module-shutdown"> + <title>Shutdown Callback</title> + + <para> + The <function>shutdown_cb</function> callback is called when the archiver + process exits (e.g., after an error) or the value of + <xref linkend="guc-archive-library"/> changes. If no + <function>shutdown_cb</function> is defined, no special action is taken in + these situations. If the archive module has any state, this callback + should free it to avoid leaks. <programlisting> typedef void (*ArchiveShutdownCB) (ArchiveModuleState *state); </programlisting> - </para> + </para> + </sect3> </sect2> </sect1> </chapter> -- 2.25.1 --3V7upXqbjpZ4EhLz Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v20-0005-introduce-restore_library.patch" ^ permalink raw reply [nested|flat] 13+ messages in thread
* [PATCH v16 4/5] restructure archive modules docs in preparation for restore modules @ 2023-02-15 22:48 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 13+ messages in thread From: Nathan Bossart @ 2023-02-15 22:48 UTC (permalink / raw) --- doc/src/sgml/archive-and-restore-modules.sgml | 206 ++++++++++-------- 1 file changed, 110 insertions(+), 96 deletions(-) diff --git a/doc/src/sgml/archive-and-restore-modules.sgml b/doc/src/sgml/archive-and-restore-modules.sgml index 7064307d9e..7ed50a3b52 100644 --- a/doc/src/sgml/archive-and-restore-modules.sgml +++ b/doc/src/sgml/archive-and-restore-modules.sgml @@ -1,9 +1,9 @@ -<!-- doc/src/sgml/archive-modules.sgml --> +<!-- doc/src/sgml/archive-and-restore-modules.sgml --> -<chapter id="archive-modules"> - <title>Archive Modules</title> - <indexterm zone="archive-modules"> - <primary>Archive Modules</primary> +<chapter id="archive-and-restore-modules"> + <title>Archive and Restore Modules</title> + <indexterm zone="archive-and-restore-modules"> + <primary>Archive and Restore Modules</primary> </indexterm> <para> @@ -14,45 +14,52 @@ performant. </para> - <para> - When a custom <xref linkend="guc-archive-library"/> is configured, PostgreSQL - will submit completed WAL files to the module, and the server will avoid - recycling or removing these WAL files until the module indicates that the files - were successfully archived. It is ultimately up to the module to decide what - to do with each WAL file, but many recommendations are listed at - <xref linkend="backup-archiving-wal"/>. - </para> - - <para> - Archiving modules must at least consist of an initialization function (see - <xref linkend="archive-module-init"/>) and the required callbacks (see - <xref linkend="archive-module-callbacks"/>). However, archive modules are - also permitted to do much more (e.g., declare GUCs and register background - workers). - </para> - <para> The <filename>contrib/basic_archive</filename> module contains a working example, which demonstrates some useful techniques. </para> - <sect1 id="archive-module-init"> - <title>Initialization Functions</title> - <indexterm zone="archive-module-init"> - <primary>_PG_archive_module_init</primary> + <sect1 id="archive-modules"> + <title>Archive Modules</title> + <indexterm zone="archive-modules"> + <primary>Archive Modules</primary> </indexterm> + + <para> + When a custom <xref linkend="guc-archive-library"/> is configured, + PostgreSQL will submit completed WAL files to the module, and the server + will avoid recycling or removing these WAL files until the module indicates + that the files were successfully archived. It is ultimately up to the + module to decide what to do with each WAL file, but many recommendations are + listed at <xref linkend="backup-archiving-wal"/>. + </para> + <para> - An archive library is loaded by dynamically loading a shared library with the - <xref linkend="guc-archive-library"/>'s name as the library base name. The - normal library search path is used to locate the library. To provide the - required archive module callbacks and to indicate that the library is - actually an archive module, it needs to provide a function named - <function>_PG_archive_module_init</function>. The result of the function - must be a pointer to a struct of type - <structname>ArchiveModuleCallbacks</structname>, which contains everything - that the core code needs to know to make use of the archive module. The - return value needs to be of server lifetime, which is typically achieved by - defining it as a <literal>static const</literal> variable in global scope. + Archiving modules must at least consist of an initialization function (see + <xref linkend="archive-module-init"/>) and the required callbacks (see + <xref linkend="archive-module-callbacks"/>). However, archive modules are + also permitted to do much more (e.g., declare GUCs and register background + workers). + </para> + + <sect2 id="archive-module-init"> + <title>Initialization Functions</title> + <indexterm zone="archive-module-init"> + <primary>_PG_archive_module_init</primary> + </indexterm> + + <para> + An archive library is loaded by dynamically loading a shared library with + the <xref linkend="guc-archive-library"/>'s name as the library base name. + The normal library search path is used to locate the library. To provide + the required archive module callbacks and to indicate that the library is + actually an archive module, it needs to provide a function named + <function>_PG_archive_module_init</function>. The result of the function + must be a pointer to a struct of type + <structname>ArchiveModuleCallbacks</structname>, which contains everything + that the core code needs to know to make use of the archive module. The + return value needs to be of server lifetime, which is typically achieved by + defining it as a <literal>static const</literal> variable in global scope. <programlisting> typedef struct ArchiveModuleCallbacks @@ -65,91 +72,98 @@ typedef struct ArchiveModuleCallbacks typedef const ArchiveModuleCallbacks *(*ArchiveModuleInit) (void); </programlisting> - Only the <function>archive_file_cb</function> callback is required. The - others are optional. - </para> - </sect1> + Only the <function>archive_file_cb</function> callback is required. The + others are optional. + </para> + </sect2> - <sect1 id="archive-module-callbacks"> - <title>Archive Module Callbacks</title> - <para> - The archive callbacks define the actual archiving behavior of the module. - The server will call them as required to process each individual WAL file. - </para> + <sect2 id="archive-module-callbacks"> + <title>Archive Module Callbacks</title> - <sect2 id="archive-module-startup"> - <title>Startup Callback</title> <para> - The <function>startup_cb</function> callback is called shortly after the - module is loaded. This callback can be used to perform any additional - initialization required. If the archive module has any state, it can use - <structfield>state->private_data</structfield> to store it. + The archive callbacks define the actual archiving behavior of the module. + The server will call them as required to process each individual WAL file. + </para> + + <sect3 id="archive-module-startup"> + <title>Startup Callback</title> + + <para> + The <function>startup_cb</function> callback is called shortly after the + module is loaded. This callback can be used to perform any additional + initialization required. If the archive module has any state, it can use + <structfield>state->private_data</structfield> to store it. <programlisting> typedef void (*ArchiveStartupCB) (ArchiveModuleState *state); </programlisting> - </para> - </sect2> + </para> + </sect3> - <sect2 id="archive-module-check"> - <title>Check Callback</title> - <para> - The <function>check_configured_cb</function> callback is called to determine - whether the module is fully configured and ready to accept WAL files (e.g., - its configuration parameters are set to valid values). If no - <function>check_configured_cb</function> is defined, the server always - assumes the module is configured. + <sect3 id="archive-module-check"> + <title>Check Callback</title> + + <para> + The <function>check_configured_cb</function> callback is called to + determine whether the module is fully configured and ready to accept WAL + files (e.g., its configuration parameters are set to valid values). If no + <function>check_configured_cb</function> is defined, the server always + assumes the module is configured. <programlisting> typedef bool (*ArchiveCheckConfiguredCB) (ArchiveModuleState *state); </programlisting> - If <literal>true</literal> is returned, the server will proceed with - archiving the file by calling the <function>archive_file_cb</function> - callback. If <literal>false</literal> is returned, archiving will not - proceed, and the archiver will emit the following message to the server log: + If <literal>true</literal> is returned, the server will proceed with + archiving the file by calling the <function>archive_file_cb</function> + callback. If <literal>false</literal> is returned, archiving will not + proceed, and the archiver will emit the following message to the server + log: <screen> WARNING: archive_mode enabled, yet archiving is not configured </screen> - In the latter case, the server will periodically call this function, and - archiving will proceed only when it returns <literal>true</literal>. - </para> - </sect2> + In the latter case, the server will periodically call this function, and + archiving will proceed only when it returns <literal>true</literal>. + </para> + </sect3> - <sect2 id="archive-module-archive"> - <title>Archive Callback</title> - <para> - The <function>archive_file_cb</function> callback is called to archive a - single WAL file. + <sect3 id="archive-module-archive"> + <title>Archive Callback</title> + + <para> + The <function>archive_file_cb</function> callback is called to archive a + single WAL file. <programlisting> typedef bool (*ArchiveFileCB) (ArchiveModuleState *state, const char *file, const char *path); </programlisting> - If <literal>true</literal> is returned, the server proceeds as if the file - was successfully archived, which may include recycling or removing the - original WAL file. If <literal>false</literal> is returned, the server will - keep the original WAL file and retry archiving later. - <replaceable>file</replaceable> will contain just the file name of the WAL - file to archive, while <replaceable>path</replaceable> contains the full - path of the WAL file (including the file name). - </para> - </sect2> - - <sect2 id="archive-module-shutdown"> - <title>Shutdown Callback</title> - <para> - The <function>shutdown_cb</function> callback is called when the archiver - process exits (e.g., after an error) or the value of - <xref linkend="guc-archive-library"/> changes. If no - <function>shutdown_cb</function> is defined, no special action is taken in - these situations. If the archive module has any state, this callback should - free it to avoid leaks. + If <literal>true</literal> is returned, the server proceeds as if the file + was successfully archived, which may include recycling or removing the + original WAL file. If <literal>false</literal> is returned, the server + will keep the original WAL file and retry archiving later. + <replaceable>file</replaceable> will contain just the file name of the WAL + file to archive, while <replaceable>path</replaceable> contains the full + path of the WAL file (including the file name). + </para> + </sect3> + + <sect3 id="archive-module-shutdown"> + <title>Shutdown Callback</title> + + <para> + The <function>shutdown_cb</function> callback is called when the archiver + process exits (e.g., after an error) or the value of + <xref linkend="guc-archive-library"/> changes. If no + <function>shutdown_cb</function> is defined, no special action is taken in + these situations. If the archive module has any state, this callback + should free it to avoid leaks. <programlisting> typedef void (*ArchiveShutdownCB) (ArchiveModuleState *state); </programlisting> - </para> + </para> + </sect3> </sect2> </sect1> </chapter> -- 2.25.1 --SLDf9lqlvOQaIe6s Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v16-0005-introduce-restore_library.patch" ^ permalink raw reply [nested|flat] 13+ messages in thread
* [PATCH v12 5/6] restructure archive modules docs in preparation for restore modules @ 2023-02-15 22:48 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 13+ messages in thread From: Nathan Bossart @ 2023-02-15 22:48 UTC (permalink / raw) --- doc/src/sgml/archive-and-restore-modules.sgml | 207 ++++++++++-------- 1 file changed, 111 insertions(+), 96 deletions(-) diff --git a/doc/src/sgml/archive-and-restore-modules.sgml b/doc/src/sgml/archive-and-restore-modules.sgml index 7cf44e82e2..f30ee591e7 100644 --- a/doc/src/sgml/archive-and-restore-modules.sgml +++ b/doc/src/sgml/archive-and-restore-modules.sgml @@ -1,9 +1,9 @@ -<!-- doc/src/sgml/archive-modules.sgml --> +<!-- doc/src/sgml/archive-and-restore-modules.sgml --> -<chapter id="archive-modules"> - <title>Archive Modules</title> - <indexterm zone="archive-modules"> - <primary>Archive Modules</primary> +<chapter id="archive-and-restore-modules"> + <title>Archive and Restore Modules</title> + <indexterm zone="archive-and-restore-modules"> + <primary>Archive and Restore Modules</primary> </indexterm> <para> @@ -14,45 +14,53 @@ performant. </para> - <para> - When a custom <xref linkend="guc-archive-library"/> is configured, PostgreSQL - will submit completed WAL files to the module, and the server will avoid - recycling or removing these WAL files until the module indicates that the files - were successfully archived. It is ultimately up to the module to decide what - to do with each WAL file, but many recommendations are listed at - <xref linkend="backup-archiving-wal"/>. - </para> - - <para> - Archiving modules must at least consist of an initialization function (see - <xref linkend="archive-module-init"/>) and the required callbacks (see - <xref linkend="archive-module-callbacks"/>). However, archive modules are - also permitted to do much more (e.g., declare GUCs and register background - workers). - </para> - <para> The <filename>contrib/basic_archive</filename> module contains a working example, which demonstrates some useful techniques. </para> - <sect1 id="archive-module-init"> - <title>Initialization Functions</title> - <indexterm zone="archive-module-init"> - <primary>_PG_archive_module_init</primary> + <sect1 id="archive-modules"> + <title>Archive Modules</title> + <indexterm zone="archive-modules"> + <primary>Archive Modules</primary> </indexterm> + + <para> + When a custom <xref linkend="guc-archive-library"/> is configured, + PostgreSQL will submit completed WAL files to the module, and the server + will avoid recycling or removing these WAL files until the module indicates + that the files were successfully archived. It is ultimately up to the + module to decide what to do with each WAL file, but many recommendations are + listed at <xref linkend="backup-archiving-wal"/>. + </para> + <para> - An archive library is loaded by dynamically loading a shared library with the - <xref linkend="guc-archive-library"/>'s name as the library base name. The - normal library search path is used to locate the library. To provide the - required archive module callbacks and to indicate that the library is - actually an archive module, it needs to provide a function named - <function>_PG_archive_module_init</function>. The result of the function - must be a pointer to a struct of type - <structname>ArchiveModuleCallbacks</structname>, which contains everything - that the core code needs to know how to make use of the archive module. The - return value needs to be of server lifetime, which is typically achieved by - defining it as a <literal>static const</literal> variable in global scope. + Archiving modules must at least consist of an initialization function (see + <xref linkend="archive-module-init"/>) and the required callbacks (see + <xref linkend="archive-module-callbacks"/>). However, archive modules are + also permitted to do much more (e.g., declare GUCs and register background + workers). + </para> + + <sect2 id="archive-module-init"> + <title>Initialization Functions</title> + <indexterm zone="archive-module-init"> + <primary>_PG_archive_module_init</primary> + </indexterm> + + <para> + An archive library is loaded by dynamically loading a shared library with + the <xref linkend="guc-archive-library"/>'s name as the library base name. + The normal library search path is used to locate the library. To provide + the required archive module callbacks and to indicate that the library is + actually an archive module, it needs to provide a function named + <function>_PG_archive_module_init</function>. The result of the function + must be a pointer to a struct of type + <structname>ArchiveModuleCallbacks</structname>, which contains everything + that the core code needs to know how to make use of the archive module. + The return value needs to be of server lifetime, which is typically + achieved by defining it as a <literal>static const</literal> variable in + global scope. <programlisting> typedef struct ArchiveModuleCallbacks @@ -65,91 +73,98 @@ typedef struct ArchiveModuleCallbacks typedef const ArchiveModuleCallbacks *(*ArchiveModuleInit) (void); </programlisting> - Only the <function>archive_file_cb</function> callback is required. The - others are optional. - </para> - </sect1> + Only the <function>archive_file_cb</function> callback is required. The + others are optional. + </para> + </sect2> - <sect1 id="archive-module-callbacks"> - <title>Archive Module Callbacks</title> - <para> - The archive callbacks define the actual archiving behavior of the module. - The server will call them as required to process each individual WAL file. - </para> + <sect2 id="archive-module-callbacks"> + <title>Archive Module Callbacks</title> - <sect2 id="archive-module-startup"> - <title>Startup Callback</title> <para> - The <function>startup_cb</function> callback is called shortly after the - module is loaded. This callback can be used to perform any additional - initialization required. If the archive module has a state, it can use - <structfield>state->private_data</structfield> to store it. + The archive callbacks define the actual archiving behavior of the module. + The server will call them as required to process each individual WAL file. + </para> + + <sect3 id="archive-module-startup"> + <title>Startup Callback</title> + + <para> + The <function>startup_cb</function> callback is called shortly after the + module is loaded. This callback can be used to perform any additional + initialization required. If the archive module has state, it can use + <structfield>state->private_data</structfield> to store it. <programlisting> typedef void (*ArchiveStartupCB) (ArchiveModuleState *state); </programlisting> - </para> - </sect2> + </para> + </sect3> - <sect2 id="archive-module-check"> - <title>Check Callback</title> - <para> - The <function>check_configured_cb</function> callback is called to determine - whether the module is fully configured and ready to accept WAL files (e.g., - its configuration parameters are set to valid values). If no - <function>check_configured_cb</function> is defined, the server always - assumes the module is configured. + <sect3 id="archive-module-check"> + <title>Check Callback</title> + + <para> + The <function>check_configured_cb</function> callback is called to + determine whether the module is fully configured and ready to accept WAL + files (e.g., its configuration parameters are set to valid values). If no + <function>check_configured_cb</function> is defined, the server always + assumes the module is configured. <programlisting> typedef bool (*ArchiveCheckConfiguredCB) (ArchiveModuleState *state); </programlisting> - If <literal>true</literal> is returned, the server will proceed with - archiving the file by calling the <function>archive_file_cb</function> - callback. If <literal>false</literal> is returned, archiving will not - proceed, and the archiver will emit the following message to the server log: + If <literal>true</literal> is returned, the server will proceed with + archiving the file by calling the <function>archive_file_cb</function> + callback. If <literal>false</literal> is returned, archiving will not + proceed, and the archiver will emit the following message to the server + log: <screen> WARNING: archive_mode enabled, yet archiving is not configured </screen> - In the latter case, the server will periodically call this function, and - archiving will proceed only when it returns <literal>true</literal>. - </para> - </sect2> + In the latter case, the server will periodically call this function, and + archiving will proceed only when it returns <literal>true</literal>. + </para> + </sect3> - <sect2 id="archive-module-archive"> - <title>Archive Callback</title> - <para> - The <function>archive_file_cb</function> callback is called to archive a - single WAL file. + <sect3 id="archive-module-archive"> + <title>Archive Callback</title> + + <para> + The <function>archive_file_cb</function> callback is called to archive a + single WAL file. <programlisting> typedef bool (*ArchiveFileCB) (ArchiveModuleState *state, const char *file, const char *path); </programlisting> - If <literal>true</literal> is returned, the server proceeds as if the file - was successfully archived, which may include recycling or removing the - original WAL file. If <literal>false</literal> is returned, the server will - keep the original WAL file and retry archiving later. - <replaceable>file</replaceable> will contain just the file name of the WAL - file to archive, while <replaceable>path</replaceable> contains the full - path of the WAL file (including the file name). - </para> - </sect2> - - <sect2 id="archive-module-shutdown"> - <title>Shutdown Callback</title> - <para> - The <function>shutdown_cb</function> callback is called when the archiver - process exits (e.g., after an error) or the value of - <xref linkend="guc-archive-library"/> changes. If no - <function>shutdown_cb</function> is defined, no special action is taken in - these situations. If the archive module has a state, this callback should - free it to avoid leaks. + If <literal>true</literal> is returned, the server proceeds as if the file + was successfully archived, which may include recycling or removing the + original WAL file. If <literal>false</literal> is returned, the server + will keep the original WAL file and retry archiving later. + <replaceable>file</replaceable> will contain just the file name of the WAL + file to archive, while <replaceable>path</replaceable> contains the full + path of the WAL file (including the file name). + </para> + </sect3> + + <sect3 id="archive-module-shutdown"> + <title>Shutdown Callback</title> + + <para> + The <function>shutdown_cb</function> callback is called when the archiver + process exits (e.g., after an error) or the value of + <xref linkend="guc-archive-library"/> changes. If no + <function>shutdown_cb</function> is defined, no special action is taken in + these situations. If the archive module has state, this callback should + free it to avoid leaks. <programlisting> typedef void (*ArchiveShutdownCB) (ArchiveModuleState *state); </programlisting> - </para> + </para> + </sect3> </sect2> </sect1> </chapter> -- 2.25.1 --YiEDa0DAkWCtVeE4 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v12-0006-introduce-restore_library.patch" ^ permalink raw reply [nested|flat] 13+ messages in thread
* [PATCH v15 6/7] restructure archive modules docs in preparation for restore modules @ 2023-02-15 22:48 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 13+ messages in thread From: Nathan Bossart @ 2023-02-15 22:48 UTC (permalink / raw) --- doc/src/sgml/archive-and-restore-modules.sgml | 206 ++++++++++-------- 1 file changed, 110 insertions(+), 96 deletions(-) diff --git a/doc/src/sgml/archive-and-restore-modules.sgml b/doc/src/sgml/archive-and-restore-modules.sgml index 7064307d9e..7ed50a3b52 100644 --- a/doc/src/sgml/archive-and-restore-modules.sgml +++ b/doc/src/sgml/archive-and-restore-modules.sgml @@ -1,9 +1,9 @@ -<!-- doc/src/sgml/archive-modules.sgml --> +<!-- doc/src/sgml/archive-and-restore-modules.sgml --> -<chapter id="archive-modules"> - <title>Archive Modules</title> - <indexterm zone="archive-modules"> - <primary>Archive Modules</primary> +<chapter id="archive-and-restore-modules"> + <title>Archive and Restore Modules</title> + <indexterm zone="archive-and-restore-modules"> + <primary>Archive and Restore Modules</primary> </indexterm> <para> @@ -14,45 +14,52 @@ performant. </para> - <para> - When a custom <xref linkend="guc-archive-library"/> is configured, PostgreSQL - will submit completed WAL files to the module, and the server will avoid - recycling or removing these WAL files until the module indicates that the files - were successfully archived. It is ultimately up to the module to decide what - to do with each WAL file, but many recommendations are listed at - <xref linkend="backup-archiving-wal"/>. - </para> - - <para> - Archiving modules must at least consist of an initialization function (see - <xref linkend="archive-module-init"/>) and the required callbacks (see - <xref linkend="archive-module-callbacks"/>). However, archive modules are - also permitted to do much more (e.g., declare GUCs and register background - workers). - </para> - <para> The <filename>contrib/basic_archive</filename> module contains a working example, which demonstrates some useful techniques. </para> - <sect1 id="archive-module-init"> - <title>Initialization Functions</title> - <indexterm zone="archive-module-init"> - <primary>_PG_archive_module_init</primary> + <sect1 id="archive-modules"> + <title>Archive Modules</title> + <indexterm zone="archive-modules"> + <primary>Archive Modules</primary> </indexterm> + + <para> + When a custom <xref linkend="guc-archive-library"/> is configured, + PostgreSQL will submit completed WAL files to the module, and the server + will avoid recycling or removing these WAL files until the module indicates + that the files were successfully archived. It is ultimately up to the + module to decide what to do with each WAL file, but many recommendations are + listed at <xref linkend="backup-archiving-wal"/>. + </para> + <para> - An archive library is loaded by dynamically loading a shared library with the - <xref linkend="guc-archive-library"/>'s name as the library base name. The - normal library search path is used to locate the library. To provide the - required archive module callbacks and to indicate that the library is - actually an archive module, it needs to provide a function named - <function>_PG_archive_module_init</function>. The result of the function - must be a pointer to a struct of type - <structname>ArchiveModuleCallbacks</structname>, which contains everything - that the core code needs to know to make use of the archive module. The - return value needs to be of server lifetime, which is typically achieved by - defining it as a <literal>static const</literal> variable in global scope. + Archiving modules must at least consist of an initialization function (see + <xref linkend="archive-module-init"/>) and the required callbacks (see + <xref linkend="archive-module-callbacks"/>). However, archive modules are + also permitted to do much more (e.g., declare GUCs and register background + workers). + </para> + + <sect2 id="archive-module-init"> + <title>Initialization Functions</title> + <indexterm zone="archive-module-init"> + <primary>_PG_archive_module_init</primary> + </indexterm> + + <para> + An archive library is loaded by dynamically loading a shared library with + the <xref linkend="guc-archive-library"/>'s name as the library base name. + The normal library search path is used to locate the library. To provide + the required archive module callbacks and to indicate that the library is + actually an archive module, it needs to provide a function named + <function>_PG_archive_module_init</function>. The result of the function + must be a pointer to a struct of type + <structname>ArchiveModuleCallbacks</structname>, which contains everything + that the core code needs to know to make use of the archive module. The + return value needs to be of server lifetime, which is typically achieved by + defining it as a <literal>static const</literal> variable in global scope. <programlisting> typedef struct ArchiveModuleCallbacks @@ -65,91 +72,98 @@ typedef struct ArchiveModuleCallbacks typedef const ArchiveModuleCallbacks *(*ArchiveModuleInit) (void); </programlisting> - Only the <function>archive_file_cb</function> callback is required. The - others are optional. - </para> - </sect1> + Only the <function>archive_file_cb</function> callback is required. The + others are optional. + </para> + </sect2> - <sect1 id="archive-module-callbacks"> - <title>Archive Module Callbacks</title> - <para> - The archive callbacks define the actual archiving behavior of the module. - The server will call them as required to process each individual WAL file. - </para> + <sect2 id="archive-module-callbacks"> + <title>Archive Module Callbacks</title> - <sect2 id="archive-module-startup"> - <title>Startup Callback</title> <para> - The <function>startup_cb</function> callback is called shortly after the - module is loaded. This callback can be used to perform any additional - initialization required. If the archive module has any state, it can use - <structfield>state->private_data</structfield> to store it. + The archive callbacks define the actual archiving behavior of the module. + The server will call them as required to process each individual WAL file. + </para> + + <sect3 id="archive-module-startup"> + <title>Startup Callback</title> + + <para> + The <function>startup_cb</function> callback is called shortly after the + module is loaded. This callback can be used to perform any additional + initialization required. If the archive module has any state, it can use + <structfield>state->private_data</structfield> to store it. <programlisting> typedef void (*ArchiveStartupCB) (ArchiveModuleState *state); </programlisting> - </para> - </sect2> + </para> + </sect3> - <sect2 id="archive-module-check"> - <title>Check Callback</title> - <para> - The <function>check_configured_cb</function> callback is called to determine - whether the module is fully configured and ready to accept WAL files (e.g., - its configuration parameters are set to valid values). If no - <function>check_configured_cb</function> is defined, the server always - assumes the module is configured. + <sect3 id="archive-module-check"> + <title>Check Callback</title> + + <para> + The <function>check_configured_cb</function> callback is called to + determine whether the module is fully configured and ready to accept WAL + files (e.g., its configuration parameters are set to valid values). If no + <function>check_configured_cb</function> is defined, the server always + assumes the module is configured. <programlisting> typedef bool (*ArchiveCheckConfiguredCB) (ArchiveModuleState *state); </programlisting> - If <literal>true</literal> is returned, the server will proceed with - archiving the file by calling the <function>archive_file_cb</function> - callback. If <literal>false</literal> is returned, archiving will not - proceed, and the archiver will emit the following message to the server log: + If <literal>true</literal> is returned, the server will proceed with + archiving the file by calling the <function>archive_file_cb</function> + callback. If <literal>false</literal> is returned, archiving will not + proceed, and the archiver will emit the following message to the server + log: <screen> WARNING: archive_mode enabled, yet archiving is not configured </screen> - In the latter case, the server will periodically call this function, and - archiving will proceed only when it returns <literal>true</literal>. - </para> - </sect2> + In the latter case, the server will periodically call this function, and + archiving will proceed only when it returns <literal>true</literal>. + </para> + </sect3> - <sect2 id="archive-module-archive"> - <title>Archive Callback</title> - <para> - The <function>archive_file_cb</function> callback is called to archive a - single WAL file. + <sect3 id="archive-module-archive"> + <title>Archive Callback</title> + + <para> + The <function>archive_file_cb</function> callback is called to archive a + single WAL file. <programlisting> typedef bool (*ArchiveFileCB) (ArchiveModuleState *state, const char *file, const char *path); </programlisting> - If <literal>true</literal> is returned, the server proceeds as if the file - was successfully archived, which may include recycling or removing the - original WAL file. If <literal>false</literal> is returned, the server will - keep the original WAL file and retry archiving later. - <replaceable>file</replaceable> will contain just the file name of the WAL - file to archive, while <replaceable>path</replaceable> contains the full - path of the WAL file (including the file name). - </para> - </sect2> - - <sect2 id="archive-module-shutdown"> - <title>Shutdown Callback</title> - <para> - The <function>shutdown_cb</function> callback is called when the archiver - process exits (e.g., after an error) or the value of - <xref linkend="guc-archive-library"/> changes. If no - <function>shutdown_cb</function> is defined, no special action is taken in - these situations. If the archive module has any state, this callback should - free it to avoid leaks. + If <literal>true</literal> is returned, the server proceeds as if the file + was successfully archived, which may include recycling or removing the + original WAL file. If <literal>false</literal> is returned, the server + will keep the original WAL file and retry archiving later. + <replaceable>file</replaceable> will contain just the file name of the WAL + file to archive, while <replaceable>path</replaceable> contains the full + path of the WAL file (including the file name). + </para> + </sect3> + + <sect3 id="archive-module-shutdown"> + <title>Shutdown Callback</title> + + <para> + The <function>shutdown_cb</function> callback is called when the archiver + process exits (e.g., after an error) or the value of + <xref linkend="guc-archive-library"/> changes. If no + <function>shutdown_cb</function> is defined, no special action is taken in + these situations. If the archive module has any state, this callback + should free it to avoid leaks. <programlisting> typedef void (*ArchiveShutdownCB) (ArchiveModuleState *state); </programlisting> - </para> + </para> + </sect3> </sect2> </sect1> </chapter> -- 2.25.1 --k+w/mQv8wyuph6w0 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v15-0007-introduce-restore_library.patch" ^ permalink raw reply [nested|flat] 13+ messages in thread
* [PATCH v13 6/7] restructure archive modules docs in preparation for restore modules @ 2023-02-15 22:48 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 13+ messages in thread From: Nathan Bossart @ 2023-02-15 22:48 UTC (permalink / raw) --- doc/src/sgml/archive-and-restore-modules.sgml | 207 ++++++++++-------- 1 file changed, 111 insertions(+), 96 deletions(-) diff --git a/doc/src/sgml/archive-and-restore-modules.sgml b/doc/src/sgml/archive-and-restore-modules.sgml index 7cf44e82e2..f30ee591e7 100644 --- a/doc/src/sgml/archive-and-restore-modules.sgml +++ b/doc/src/sgml/archive-and-restore-modules.sgml @@ -1,9 +1,9 @@ -<!-- doc/src/sgml/archive-modules.sgml --> +<!-- doc/src/sgml/archive-and-restore-modules.sgml --> -<chapter id="archive-modules"> - <title>Archive Modules</title> - <indexterm zone="archive-modules"> - <primary>Archive Modules</primary> +<chapter id="archive-and-restore-modules"> + <title>Archive and Restore Modules</title> + <indexterm zone="archive-and-restore-modules"> + <primary>Archive and Restore Modules</primary> </indexterm> <para> @@ -14,45 +14,53 @@ performant. </para> - <para> - When a custom <xref linkend="guc-archive-library"/> is configured, PostgreSQL - will submit completed WAL files to the module, and the server will avoid - recycling or removing these WAL files until the module indicates that the files - were successfully archived. It is ultimately up to the module to decide what - to do with each WAL file, but many recommendations are listed at - <xref linkend="backup-archiving-wal"/>. - </para> - - <para> - Archiving modules must at least consist of an initialization function (see - <xref linkend="archive-module-init"/>) and the required callbacks (see - <xref linkend="archive-module-callbacks"/>). However, archive modules are - also permitted to do much more (e.g., declare GUCs and register background - workers). - </para> - <para> The <filename>contrib/basic_archive</filename> module contains a working example, which demonstrates some useful techniques. </para> - <sect1 id="archive-module-init"> - <title>Initialization Functions</title> - <indexterm zone="archive-module-init"> - <primary>_PG_archive_module_init</primary> + <sect1 id="archive-modules"> + <title>Archive Modules</title> + <indexterm zone="archive-modules"> + <primary>Archive Modules</primary> </indexterm> + + <para> + When a custom <xref linkend="guc-archive-library"/> is configured, + PostgreSQL will submit completed WAL files to the module, and the server + will avoid recycling or removing these WAL files until the module indicates + that the files were successfully archived. It is ultimately up to the + module to decide what to do with each WAL file, but many recommendations are + listed at <xref linkend="backup-archiving-wal"/>. + </para> + <para> - An archive library is loaded by dynamically loading a shared library with the - <xref linkend="guc-archive-library"/>'s name as the library base name. The - normal library search path is used to locate the library. To provide the - required archive module callbacks and to indicate that the library is - actually an archive module, it needs to provide a function named - <function>_PG_archive_module_init</function>. The result of the function - must be a pointer to a struct of type - <structname>ArchiveModuleCallbacks</structname>, which contains everything - that the core code needs to know how to make use of the archive module. The - return value needs to be of server lifetime, which is typically achieved by - defining it as a <literal>static const</literal> variable in global scope. + Archiving modules must at least consist of an initialization function (see + <xref linkend="archive-module-init"/>) and the required callbacks (see + <xref linkend="archive-module-callbacks"/>). However, archive modules are + also permitted to do much more (e.g., declare GUCs and register background + workers). + </para> + + <sect2 id="archive-module-init"> + <title>Initialization Functions</title> + <indexterm zone="archive-module-init"> + <primary>_PG_archive_module_init</primary> + </indexterm> + + <para> + An archive library is loaded by dynamically loading a shared library with + the <xref linkend="guc-archive-library"/>'s name as the library base name. + The normal library search path is used to locate the library. To provide + the required archive module callbacks and to indicate that the library is + actually an archive module, it needs to provide a function named + <function>_PG_archive_module_init</function>. The result of the function + must be a pointer to a struct of type + <structname>ArchiveModuleCallbacks</structname>, which contains everything + that the core code needs to know how to make use of the archive module. + The return value needs to be of server lifetime, which is typically + achieved by defining it as a <literal>static const</literal> variable in + global scope. <programlisting> typedef struct ArchiveModuleCallbacks @@ -65,91 +73,98 @@ typedef struct ArchiveModuleCallbacks typedef const ArchiveModuleCallbacks *(*ArchiveModuleInit) (void); </programlisting> - Only the <function>archive_file_cb</function> callback is required. The - others are optional. - </para> - </sect1> + Only the <function>archive_file_cb</function> callback is required. The + others are optional. + </para> + </sect2> - <sect1 id="archive-module-callbacks"> - <title>Archive Module Callbacks</title> - <para> - The archive callbacks define the actual archiving behavior of the module. - The server will call them as required to process each individual WAL file. - </para> + <sect2 id="archive-module-callbacks"> + <title>Archive Module Callbacks</title> - <sect2 id="archive-module-startup"> - <title>Startup Callback</title> <para> - The <function>startup_cb</function> callback is called shortly after the - module is loaded. This callback can be used to perform any additional - initialization required. If the archive module has a state, it can use - <structfield>state->private_data</structfield> to store it. + The archive callbacks define the actual archiving behavior of the module. + The server will call them as required to process each individual WAL file. + </para> + + <sect3 id="archive-module-startup"> + <title>Startup Callback</title> + + <para> + The <function>startup_cb</function> callback is called shortly after the + module is loaded. This callback can be used to perform any additional + initialization required. If the archive module has state, it can use + <structfield>state->private_data</structfield> to store it. <programlisting> typedef void (*ArchiveStartupCB) (ArchiveModuleState *state); </programlisting> - </para> - </sect2> + </para> + </sect3> - <sect2 id="archive-module-check"> - <title>Check Callback</title> - <para> - The <function>check_configured_cb</function> callback is called to determine - whether the module is fully configured and ready to accept WAL files (e.g., - its configuration parameters are set to valid values). If no - <function>check_configured_cb</function> is defined, the server always - assumes the module is configured. + <sect3 id="archive-module-check"> + <title>Check Callback</title> + + <para> + The <function>check_configured_cb</function> callback is called to + determine whether the module is fully configured and ready to accept WAL + files (e.g., its configuration parameters are set to valid values). If no + <function>check_configured_cb</function> is defined, the server always + assumes the module is configured. <programlisting> typedef bool (*ArchiveCheckConfiguredCB) (ArchiveModuleState *state); </programlisting> - If <literal>true</literal> is returned, the server will proceed with - archiving the file by calling the <function>archive_file_cb</function> - callback. If <literal>false</literal> is returned, archiving will not - proceed, and the archiver will emit the following message to the server log: + If <literal>true</literal> is returned, the server will proceed with + archiving the file by calling the <function>archive_file_cb</function> + callback. If <literal>false</literal> is returned, archiving will not + proceed, and the archiver will emit the following message to the server + log: <screen> WARNING: archive_mode enabled, yet archiving is not configured </screen> - In the latter case, the server will periodically call this function, and - archiving will proceed only when it returns <literal>true</literal>. - </para> - </sect2> + In the latter case, the server will periodically call this function, and + archiving will proceed only when it returns <literal>true</literal>. + </para> + </sect3> - <sect2 id="archive-module-archive"> - <title>Archive Callback</title> - <para> - The <function>archive_file_cb</function> callback is called to archive a - single WAL file. + <sect3 id="archive-module-archive"> + <title>Archive Callback</title> + + <para> + The <function>archive_file_cb</function> callback is called to archive a + single WAL file. <programlisting> typedef bool (*ArchiveFileCB) (ArchiveModuleState *state, const char *file, const char *path); </programlisting> - If <literal>true</literal> is returned, the server proceeds as if the file - was successfully archived, which may include recycling or removing the - original WAL file. If <literal>false</literal> is returned, the server will - keep the original WAL file and retry archiving later. - <replaceable>file</replaceable> will contain just the file name of the WAL - file to archive, while <replaceable>path</replaceable> contains the full - path of the WAL file (including the file name). - </para> - </sect2> - - <sect2 id="archive-module-shutdown"> - <title>Shutdown Callback</title> - <para> - The <function>shutdown_cb</function> callback is called when the archiver - process exits (e.g., after an error) or the value of - <xref linkend="guc-archive-library"/> changes. If no - <function>shutdown_cb</function> is defined, no special action is taken in - these situations. If the archive module has a state, this callback should - free it to avoid leaks. + If <literal>true</literal> is returned, the server proceeds as if the file + was successfully archived, which may include recycling or removing the + original WAL file. If <literal>false</literal> is returned, the server + will keep the original WAL file and retry archiving later. + <replaceable>file</replaceable> will contain just the file name of the WAL + file to archive, while <replaceable>path</replaceable> contains the full + path of the WAL file (including the file name). + </para> + </sect3> + + <sect3 id="archive-module-shutdown"> + <title>Shutdown Callback</title> + + <para> + The <function>shutdown_cb</function> callback is called when the archiver + process exits (e.g., after an error) or the value of + <xref linkend="guc-archive-library"/> changes. If no + <function>shutdown_cb</function> is defined, no special action is taken in + these situations. If the archive module has state, this callback should + free it to avoid leaks. <programlisting> typedef void (*ArchiveShutdownCB) (ArchiveModuleState *state); </programlisting> - </para> + </para> + </sect3> </sect2> </sect1> </chapter> -- 2.25.1 --5vNYLRcllDrimb99 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v13-0007-introduce-restore_library.patch" ^ permalink raw reply [nested|flat] 13+ messages in thread
end of thread, other threads:[~2023-02-15 22:48 UTC | newest] Thread overview: 13+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-09-12 13:07 [PATCH 1/8] Pass all scan keys to BRIN consistent function at once Tomas Vondra <[email protected]> 2023-02-15 22:48 [PATCH v23 4/5] restructure archive modules docs in preparation for restore modules Nathan Bossart <[email protected]> 2023-02-15 22:48 [PATCH v19 4/5] restructure archive modules docs in preparation for restore modules Nathan Bossart <[email protected]> 2023-02-15 22:48 [PATCH v15 6/7] restructure archive modules docs in preparation for restore modules Nathan Bossart <[email protected]> 2023-02-15 22:48 [PATCH v13 6/7] restructure archive modules docs in preparation for restore modules Nathan Bossart <[email protected]> 2023-02-15 22:48 [PATCH v14 6/7] restructure archive modules docs in preparation for restore modules Nathan Bossart <[email protected]> 2023-02-15 22:48 [PATCH v18 4/5] restructure archive modules docs in preparation for restore modules Nathan Bossart <[email protected]> 2023-02-15 22:48 [PATCH v21 4/5] restructure archive modules docs in preparation for restore modules Nathan Bossart <[email protected]> 2023-02-15 22:48 [PATCH v20 4/5] restructure archive modules docs in preparation for restore modules Nathan Bossart <[email protected]> 2023-02-15 22:48 [PATCH v16 4/5] restructure archive modules docs in preparation for restore modules Nathan Bossart <[email protected]> 2023-02-15 22:48 [PATCH v12 5/6] restructure archive modules docs in preparation for restore modules Nathan Bossart <[email protected]> 2023-02-15 22:48 [PATCH v17 4/5] restructure archive modules docs in preparation for restore modules Nathan Bossart <[email protected]> 2023-02-15 22:48 [PATCH v22 4/5] restructure archive modules docs in preparation for restore modules Nathan Bossart <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox