Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdd778e9

Browse files
committed
Rename various "freeze multixact" variables
It seems to make more sense to use "cutoff multixact" terminologythroughout the backend code; "freeze" is associated with replacing of anXid with FrozenTransactionId, which is not what we do for MultiXactIds.Andres FreundSome adjustments by Álvaro Herrera
1 parent0892ecb commitdd778e9

File tree

11 files changed

+61
-61
lines changed

11 files changed

+61
-61
lines changed

‎src/backend/access/heap/heapam.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5135,8 +5135,8 @@ heap_freeze_tuple(HeapTupleHeader tuple, TransactionId cutoff_xid,
51355135

51365136
/*
51375137
* Note that this code handles IS_MULTI Xmax values, too, but only to mark
5138-
* the tuplefrozen if the updating Xid inthemxact is below thefreeze
5139-
*cutoff; it doesn't remove dead members of a very old multixact.
5138+
* the tupleas not updated ifthemultixact is below thecutoff Multixact
5139+
*given; it doesn't remove dead members of a very old multixact.
51405140
*/
51415141
xid=HeapTupleHeaderGetRawXmax(tuple);
51425142
if ((tuple->t_infomask&HEAP_XMAX_IS_MULTI) ?

‎src/backend/access/heap/rewriteheap.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ typedef struct RewriteStateData
129129
* determine tuple visibility */
130130
TransactionIdrs_freeze_xid;/* Xid that will be used as freeze cutoff
131131
* point */
132-
MultiXactIdrs_freeze_multi;/* MultiXactId that will be used asfreeze
133-
*cutoffpoint for multixacts */
132+
MultiXactIdrs_cutoff_multi;/* MultiXactId that will be used ascutoff
133+
* point for multixacts */
134134
MemoryContextrs_cxt;/* for hash tables and entries and tuples in
135135
* them */
136136
HTAB*rs_unresolved_tups;/* unmatched A tuples */
@@ -180,15 +180,15 @@ static void raw_heap_insert(RewriteState state, HeapTuple tup);
180180
* new_heapnew, locked heap relation to insert tuples to
181181
* oldest_xminxid used by the caller to determine which tuples are dead
182182
* freeze_xidxid before which tuples will be frozen
183-
*freeze_multimultixact before which multis will befrozen
183+
*min_multimultixact before which multis will beremoved
184184
* use_walshould the inserts to the new heap be WAL-logged?
185185
*
186186
* Returns an opaque RewriteState, allocated in current memory context,
187187
* to be used in subsequent calls to the other functions.
188188
*/
189189
RewriteState
190190
begin_heap_rewrite(Relationnew_heap,TransactionIdoldest_xmin,
191-
TransactionIdfreeze_xid,MultiXactIdfreeze_multi,
191+
TransactionIdfreeze_xid,MultiXactIdcutoff_multi,
192192
booluse_wal)
193193
{
194194
RewriteStatestate;
@@ -218,7 +218,7 @@ begin_heap_rewrite(Relation new_heap, TransactionId oldest_xmin,
218218
state->rs_use_wal=use_wal;
219219
state->rs_oldest_xmin=oldest_xmin;
220220
state->rs_freeze_xid=freeze_xid;
221-
state->rs_freeze_multi=freeze_multi;
221+
state->rs_cutoff_multi=cutoff_multi;
222222
state->rs_cxt=rw_cxt;
223223

224224
/* Initialize hash tables used to track update chains */
@@ -347,7 +347,7 @@ rewrite_heap_tuple(RewriteState state,
347347
* very-old xmin or xmax, so that future VACUUM effort can be saved.
348348
*/
349349
heap_freeze_tuple(new_tuple->t_data,state->rs_freeze_xid,
350-
state->rs_freeze_multi);
350+
state->rs_cutoff_multi);
351351

352352
/*
353353
* Invalid ctid means that ctid should point to the tuple itself. We'll

‎src/backend/access/transam/multixact.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ GetMultiXactIdMembers(MultiXactId multi, MultiXactMember **members,
10691069
* We check known limits on MultiXact before resorting to the SLRU area.
10701070
*
10711071
* An ID older than MultiXactState->oldestMultiXactId cannot possibly be
1072-
* useful; it should have already beenfrozen by vacuum. We've truncated
1072+
* useful; it should have already beenremoved by vacuum. We've truncated
10731073
* the on-disk structures anyway. Returning the wrong values could lead
10741074
* to an incorrect visibility result. However, to support pg_upgrade we
10751075
* need to allow an empty set to be returned regardless, if the caller is

‎src/backend/commands/cluster.c

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static void rebuild_relation(Relation OldHeap, Oid indexOid,
6969
staticvoidcopy_heap_data(OidOIDNewHeap,OidOIDOldHeap,OidOIDOldIndex,
7070
intfreeze_min_age,intfreeze_table_age,boolverbose,
7171
bool*pSwapToastByContent,TransactionId*pFreezeXid,
72-
MultiXactId*pFreezeMulti);
72+
MultiXactId*pCutoffMulti);
7373
staticList*get_tables_to_cluster(MemoryContextcluster_context);
7474
staticvoidreform_and_rewrite_tuple(HeapTupletuple,
7575
TupleDescoldTupDesc,TupleDescnewTupDesc,
@@ -566,7 +566,7 @@ rebuild_relation(Relation OldHeap, Oid indexOid,
566566
boolis_system_catalog;
567567
boolswap_toast_by_content;
568568
TransactionIdfrozenXid;
569-
MultiXactIdfrozenMulti;
569+
MultiXactIdcutoffMulti;
570570

571571
/* Mark the correct index as clustered */
572572
if (OidIsValid(indexOid))
@@ -585,15 +585,15 @@ rebuild_relation(Relation OldHeap, Oid indexOid,
585585
/* Copy the heap data into the new table in the desired order */
586586
copy_heap_data(OIDNewHeap,tableOid,indexOid,
587587
freeze_min_age,freeze_table_age,verbose,
588-
&swap_toast_by_content,&frozenXid,&frozenMulti);
588+
&swap_toast_by_content,&frozenXid,&cutoffMulti);
589589

590590
/*
591591
* Swap the physical files of the target and transient tables, then
592592
* rebuild the target's indexes and throw away the transient table.
593593
*/
594594
finish_heap_swap(tableOid,OIDNewHeap,is_system_catalog,
595595
swap_toast_by_content, false, true,
596-
frozenXid,frozenMulti);
596+
frozenXid,cutoffMulti);
597597
}
598598

599599

@@ -736,12 +736,13 @@ make_new_heap(Oid OIDOldHeap, Oid NewTableSpace, bool forcetemp,
736736
* There are two output parameters:
737737
* *pSwapToastByContent is set true if toast tables must be swapped by content.
738738
* *pFreezeXid receives the TransactionId used as freeze cutoff point.
739+
* *pCutoffMulti receives the MultiXactId used as a cutoff point.
739740
*/
740741
staticvoid
741742
copy_heap_data(OidOIDNewHeap,OidOIDOldHeap,OidOIDOldIndex,
742743
intfreeze_min_age,intfreeze_table_age,boolverbose,
743744
bool*pSwapToastByContent,TransactionId*pFreezeXid,
744-
MultiXactId*pFreezeMulti)
745+
MultiXactId*pCutoffMulti)
745746
{
746747
RelationNewHeap,
747748
OldHeap,
@@ -757,7 +758,7 @@ copy_heap_data(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex,
757758
boolis_system_catalog;
758759
TransactionIdOldestXmin;
759760
TransactionIdFreezeXid;
760-
MultiXactIdMultiXactFrzLimit;
761+
MultiXactIdMultiXactCutoff;
761762
RewriteStaterwstate;
762763
booluse_sort;
763764
Tuplesortstate*tuplesort;
@@ -858,7 +859,7 @@ copy_heap_data(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex,
858859
*/
859860
vacuum_set_xid_limits(freeze_min_age,freeze_table_age,
860861
OldHeap->rd_rel->relisshared,
861-
&OldestXmin,&FreezeXid,NULL,&MultiXactFrzLimit);
862+
&OldestXmin,&FreezeXid,NULL,&MultiXactCutoff);
862863

863864
/*
864865
* FreezeXid will become the table's new relfrozenxid, and that mustn't go
@@ -869,14 +870,14 @@ copy_heap_data(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex,
869870

870871
/* return selected values to caller */
871872
*pFreezeXid=FreezeXid;
872-
*pFreezeMulti=MultiXactFrzLimit;
873+
*pCutoffMulti=MultiXactCutoff;
873874

874875
/* Remember if it's a system catalog */
875876
is_system_catalog=IsSystemRelation(OldHeap);
876877

877878
/* Initialize the rewrite operation */
878879
rwstate=begin_heap_rewrite(NewHeap,OldestXmin,FreezeXid,
879-
MultiXactFrzLimit,use_wal);
880+
MultiXactCutoff,use_wal);
880881

881882
/*
882883
* Decide whether to use an indexscan or seqscan-and-optional-sort to scan
@@ -1135,7 +1136,7 @@ swap_relation_files(Oid r1, Oid r2, bool target_is_pg_class,
11351136
boolswap_toast_by_content,
11361137
boolis_internal,
11371138
TransactionIdfrozenXid,
1138-
MultiXactIdfrozenMulti,
1139+
MultiXactIdcutoffMulti,
11391140
Oid*mapped_tables)
11401141
{
11411142
RelationrelRelation;
@@ -1246,8 +1247,8 @@ swap_relation_files(Oid r1, Oid r2, bool target_is_pg_class,
12461247
{
12471248
Assert(TransactionIdIsNormal(frozenXid));
12481249
relform1->relfrozenxid=frozenXid;
1249-
Assert(MultiXactIdIsValid(frozenMulti));
1250-
relform1->relminmxid=frozenMulti;
1250+
Assert(MultiXactIdIsValid(cutoffMulti));
1251+
relform1->relminmxid=cutoffMulti;
12511252
}
12521253

12531254
/* swap size statistics too, since new rel has freshly-updated stats */
@@ -1321,7 +1322,7 @@ swap_relation_files(Oid r1, Oid r2, bool target_is_pg_class,
13211322
swap_toast_by_content,
13221323
is_internal,
13231324
frozenXid,
1324-
frozenMulti,
1325+
cutoffMulti,
13251326
mapped_tables);
13261327
}
13271328
else
@@ -1464,7 +1465,7 @@ finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap,
14641465
boolcheck_constraints,
14651466
boolis_internal,
14661467
TransactionIdfrozenXid,
1467-
MultiXactIdfrozenMulti)
1468+
MultiXactIdcutoffMulti)
14681469
{
14691470
ObjectAddressobject;
14701471
Oidmapped_tables[4];
@@ -1481,7 +1482,7 @@ finish_heap_swap(Oid OIDOldHeap, Oid OIDNewHeap,
14811482
swap_relation_files(OIDOldHeap,OIDNewHeap,
14821483
(OIDOldHeap==RelationRelationId),
14831484
swap_toast_by_content,is_internal,
1484-
frozenXid,frozenMulti,mapped_tables);
1485+
frozenXid,cutoffMulti,mapped_tables);
14851486

14861487
/*
14871488
* If it's a system catalog, queue an sinval message to flush all

‎src/backend/commands/dbcommands.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1664,7 +1664,7 @@ get_db_info(const char *name, LOCKMODE lockmode,
16641664
/* limit of frozen XIDs */
16651665
if (dbFrozenXidP)
16661666
*dbFrozenXidP=dbform->datfrozenxid;
1667-
/*limit of frozen Multixacts */
1667+
/*minimum MultixactId */
16681668
if (dbMinMultiP)
16691669
*dbMinMultiP=dbform->datminmxid;
16701670
/* default tablespace for this database */

‎src/backend/commands/vacuum.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static BufferAccessStrategy vac_strategy;
6464

6565
/* non-export function prototypes */
6666
staticList*get_rel_oids(Oidrelid,constRangeVar*vacrel);
67-
staticvoidvac_truncate_clog(TransactionIdfrozenXID,MultiXactIdfrozenMulti);
67+
staticvoidvac_truncate_clog(TransactionIdfrozenXID,MultiXactIdminMulti);
6868
staticboolvacuum_rel(Oidrelid,VacuumStmt*vacstmt,booldo_toast,
6969
boolfor_wraparound);
7070

@@ -384,7 +384,7 @@ vacuum_set_xid_limits(int freeze_min_age,
384384
TransactionId*oldestXmin,
385385
TransactionId*freezeLimit,
386386
TransactionId*freezeTableLimit,
387-
MultiXactId*multiXactFrzLimit)
387+
MultiXactId*multiXactCutoff)
388388
{
389389
intfreezemin;
390390
TransactionIdlimit;
@@ -469,7 +469,7 @@ vacuum_set_xid_limits(int freeze_min_age,
469469
*freezeTableLimit=limit;
470470
}
471471

472-
if (multiXactFrzLimit!=NULL)
472+
if (multiXactCutoff!=NULL)
473473
{
474474
MultiXactIdmxLimit;
475475

@@ -481,7 +481,7 @@ vacuum_set_xid_limits(int freeze_min_age,
481481
if (mxLimit<FirstMultiXactId)
482482
mxLimit=FirstMultiXactId;
483483

484-
*multiXactFrzLimit=mxLimit;
484+
*multiXactCutoff=mxLimit;
485485
}
486486
}
487487

@@ -690,8 +690,8 @@ vac_update_relstats(Relation relation,
690690
*Update pg_database's datfrozenxid entry for our database to be the
691691
*minimum of the pg_class.relfrozenxid values.
692692
*
693-
*Similarly, update ourdatfrozenmulti to be the minimum of the
694-
*pg_class.relfrozenmulti values.
693+
*Similarly, update ourdatminmxid to be the minimum of the
694+
*pg_class.relminmxid values.
695695
*
696696
*If we are able to advance either pg_database value, also try to
697697
*truncate pg_clog and pg_multixact.
@@ -711,7 +711,7 @@ vac_update_datfrozenxid(void)
711711
SysScanDescscan;
712712
HeapTupleclassTup;
713713
TransactionIdnewFrozenXid;
714-
MultiXactIdnewFrozenMulti;
714+
MultiXactIdnewMinMulti;
715715
booldirty= false;
716716

717717
/*
@@ -726,7 +726,7 @@ vac_update_datfrozenxid(void)
726726
* Similarly, initialize the MultiXact "min" with the value that would be
727727
* used on pg_class for new tables. See AddNewRelationTuple().
728728
*/
729-
newFrozenMulti=GetOldestMultiXactId();
729+
newMinMulti=GetOldestMultiXactId();
730730

731731
/*
732732
* We must seqscan pg_class to find the minimum Xid, because there is no
@@ -756,16 +756,16 @@ vac_update_datfrozenxid(void)
756756
if (TransactionIdPrecedes(classForm->relfrozenxid,newFrozenXid))
757757
newFrozenXid=classForm->relfrozenxid;
758758

759-
if (MultiXactIdPrecedes(classForm->relminmxid,newFrozenMulti))
760-
newFrozenMulti=classForm->relminmxid;
759+
if (MultiXactIdPrecedes(classForm->relminmxid,newMinMulti))
760+
newMinMulti=classForm->relminmxid;
761761
}
762762

763763
/* we're done with pg_class */
764764
systable_endscan(scan);
765765
heap_close(relation,AccessShareLock);
766766

767767
Assert(TransactionIdIsNormal(newFrozenXid));
768-
Assert(MultiXactIdIsValid(newFrozenMulti));
768+
Assert(MultiXactIdIsValid(newMinMulti));
769769

770770
/* Now fetch the pg_database tuple we need to update. */
771771
relation=heap_open(DatabaseRelationId,RowExclusiveLock);
@@ -787,9 +787,9 @@ vac_update_datfrozenxid(void)
787787
}
788788

789789
/* ditto */
790-
if (MultiXactIdPrecedes(dbform->datminmxid,newFrozenMulti))
790+
if (MultiXactIdPrecedes(dbform->datminmxid,newMinMulti))
791791
{
792-
dbform->datminmxid=newFrozenMulti;
792+
dbform->datminmxid=newMinMulti;
793793
dirty= true;
794794
}
795795

@@ -805,7 +805,7 @@ vac_update_datfrozenxid(void)
805805
* this action will update that too.
806806
*/
807807
if (dirty||ForceTransactionIdLimitUpdate())
808-
vac_truncate_clog(newFrozenXid,newFrozenMulti);
808+
vac_truncate_clog(newFrozenXid,newMinMulti);
809809
}
810810

811811

@@ -824,19 +824,19 @@ vac_update_datfrozenxid(void)
824824
*info is stale.
825825
*/
826826
staticvoid
827-
vac_truncate_clog(TransactionIdfrozenXID,MultiXactIdfrozenMulti)
827+
vac_truncate_clog(TransactionIdfrozenXID,MultiXactIdminMulti)
828828
{
829829
TransactionIdmyXID=GetCurrentTransactionId();
830830
Relationrelation;
831831
HeapScanDescscan;
832832
HeapTupletuple;
833833
Oidoldestxid_datoid;
834-
Oidoldestmulti_datoid;
834+
Oidminmulti_datoid;
835835
boolfrozenAlreadyWrapped= false;
836836

837837
/* init oldest datoids to sync with my frozen values */
838838
oldestxid_datoid=MyDatabaseId;
839-
oldestmulti_datoid=MyDatabaseId;
839+
minmulti_datoid=MyDatabaseId;
840840

841841
/*
842842
* Scan pg_database to compute the minimum datfrozenxid
@@ -869,10 +869,10 @@ vac_truncate_clog(TransactionId frozenXID, MultiXactId frozenMulti)
869869
oldestxid_datoid=HeapTupleGetOid(tuple);
870870
}
871871

872-
if (MultiXactIdPrecedes(dbform->datminmxid,frozenMulti))
872+
if (MultiXactIdPrecedes(dbform->datminmxid,minMulti))
873873
{
874-
frozenMulti=dbform->datminmxid;
875-
oldestmulti_datoid=HeapTupleGetOid(tuple);
874+
minMulti=dbform->datminmxid;
875+
minmulti_datoid=HeapTupleGetOid(tuple);
876876
}
877877
}
878878

@@ -896,7 +896,7 @@ vac_truncate_clog(TransactionId frozenXID, MultiXactId frozenMulti)
896896

897897
/* Truncate CLOG and Multi to the oldest computed value */
898898
TruncateCLOG(frozenXID);
899-
TruncateMultiXact(frozenMulti);
899+
TruncateMultiXact(minMulti);
900900

901901
/*
902902
* Update the wrap limit for GetNewTransactionId and creation of new
@@ -905,7 +905,7 @@ vac_truncate_clog(TransactionId frozenXID, MultiXactId frozenMulti)
905905
* signalling twice?
906906
*/
907907
SetTransactionIdLimit(frozenXID,oldestxid_datoid);
908-
MultiXactAdvanceOldest(frozenMulti,oldestmulti_datoid);
908+
MultiXactAdvanceOldest(minMulti,minmulti_datoid);
909909
}
910910

911911

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp