PostgreSQL Source Code  git master
relmapper.h File Reference
#include "access/xlogreader.h"
#include "lib/stringinfo.h"
Include dependency graph for relmapper.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  xl_relmap_update
 

Macros

#define XLOG_RELMAP_UPDATE   0x00
 
#define MinSizeOfRelmapUpdate   offsetof(xl_relmap_update, data)
 

Typedefs

typedef struct xl_relmap_update xl_relmap_update
 

Functions

Oid RelationMapOidToFilenode (Oid relationId, bool shared)
 
Oid RelationMapFilenodeToOid (Oid relationId, bool shared)
 
void RelationMapUpdateMap (Oid relationId, Oid fileNode, bool shared, bool immediate)
 
void RelationMapRemoveMapping (Oid relationId)
 
void RelationMapInvalidate (bool shared)
 
void RelationMapInvalidateAll (void)
 
void AtCCI_RelationMap (void)
 
void AtEOXact_RelationMap (bool isCommit, bool isParallelWorker)
 
void AtPrepare_RelationMap (void)
 
void CheckPointRelationMap (void)
 
void RelationMapFinishBootstrap (void)
 
void RelationMapInitialize (void)
 
void RelationMapInitializePhase2 (void)
 
void RelationMapInitializePhase3 (void)
 
Size EstimateRelationMapSpace (void)
 
void SerializeRelationMap (Size maxSize, char *startAddress)
 
void RestoreRelationMap (char *startAddress)
 
void relmap_redo (XLogReaderState *record)
 
void relmap_desc (StringInfo buf, XLogReaderState *record)
 
const char * relmap_identify (uint8 info)
 

Macro Definition Documentation

◆ MinSizeOfRelmapUpdate

#define MinSizeOfRelmapUpdate   offsetof(xl_relmap_update, data)

Definition at line 35 of file relmapper.h.

Referenced by write_relmap_file().

◆ XLOG_RELMAP_UPDATE

#define XLOG_RELMAP_UPDATE   0x00

Definition at line 25 of file relmapper.h.

Referenced by relmap_desc(), relmap_identify(), relmap_redo(), and write_relmap_file().

Typedef Documentation

◆ xl_relmap_update

Function Documentation

◆ AtCCI_RelationMap()

void AtCCI_RelationMap ( void  )

Definition at line 439 of file relmapper.c.

References merge_map_updates(), and RelMapFile::num_mappings.

Referenced by AtCCI_LocalCache().

440 {
442  {
445  true);
447  }
449  {
452  true);
454  }
455 }
static void merge_map_updates(RelMapFile *map, const RelMapFile *updates, bool add_okay)
Definition: relmapper.c:351
static RelMapFile pending_shared_updates
Definition: relmapper.c:130
static RelMapFile active_local_updates
Definition: relmapper.c:129
static RelMapFile pending_local_updates
Definition: relmapper.c:131
static RelMapFile active_shared_updates
Definition: relmapper.c:128
int32 num_mappings
Definition: relmapper.c:88

◆ AtEOXact_RelationMap()

void AtEOXact_RelationMap ( bool  isCommit,
bool  isParallelWorker 
)

Definition at line 476 of file relmapper.c.

References Assert, RelMapFile::num_mappings, and perform_relmap_update().

Referenced by AbortTransaction(), and CommitTransaction().

477 {
478  if (isCommit && !isParallelWorker)
479  {
480  /*
481  * We should not get here with any "pending" updates. (We could
482  * logically choose to treat such as committed, but in the current
483  * code this should never happen.)
484  */
487 
488  /*
489  * Write any active updates to the actual map files, then reset them.
490  */
492  {
495  }
497  {
500  }
501  }
502  else
503  {
504  /* Abort or parallel worker --- drop all local and pending updates */
505  Assert(!isParallelWorker || pending_shared_updates.num_mappings == 0);
506  Assert(!isParallelWorker || pending_local_updates.num_mappings == 0);
507 
512  }
513 }
static RelMapFile pending_shared_updates
Definition: relmapper.c:130
static void perform_relmap_update(bool shared, const RelMapFile *updates)
Definition: relmapper.c:945
static RelMapFile active_local_updates
Definition: relmapper.c:129
static RelMapFile pending_local_updates
Definition: relmapper.c:131
static RelMapFile active_shared_updates
Definition: relmapper.c:128
#define Assert(condition)
Definition: c.h:732
int32 num_mappings
Definition: relmapper.c:88

◆ AtPrepare_RelationMap()

void AtPrepare_RelationMap ( void  )

Definition at line 523 of file relmapper.c.

References ereport, errcode(), errmsg(), ERROR, and RelMapFile::num_mappings.

Referenced by PrepareTransaction().

524 {
529  ereport(ERROR,
530  (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
531  errmsg("cannot PREPARE a transaction that modified relation mapping")));
532 }
int errcode(int sqlerrcode)
Definition: elog.c:570
static RelMapFile pending_shared_updates
Definition: relmapper.c:130
#define ERROR
Definition: elog.h:43
static RelMapFile active_local_updates
Definition: relmapper.c:129
static RelMapFile pending_local_updates
Definition: relmapper.c:131
#define ereport(elevel, rest)
Definition: elog.h:141
static RelMapFile active_shared_updates
Definition: relmapper.c:128
int errmsg(const char *fmt,...)
Definition: elog.c:784
int32 num_mappings
Definition: relmapper.c:88

◆ CheckPointRelationMap()

void CheckPointRelationMap ( void  )

Definition at line 546 of file relmapper.c.

References LW_SHARED, LWLockAcquire(), and LWLockRelease().

Referenced by CheckPointGuts().

547 {
548  LWLockAcquire(RelationMappingLock, LW_SHARED);
549  LWLockRelease(RelationMappingLock);
550 }
void LWLockRelease(LWLock *lock)
Definition: lwlock.c:1726
bool LWLockAcquire(LWLock *lock, LWLockMode mode)
Definition: lwlock.c:1122

◆ EstimateRelationMapSpace()

Size EstimateRelationMapSpace ( void  )

Definition at line 646 of file relmapper.c.

Referenced by InitializeParallelDSM(), and SerializeRelationMap().

647 {
648  return sizeof(SerializedActiveRelMaps);
649 }
struct SerializedActiveRelMaps SerializedActiveRelMaps

◆ RelationMapFilenodeToOid()

Oid RelationMapFilenodeToOid ( Oid  relationId,
bool  shared 
)

Definition at line 212 of file relmapper.c.

References active_local_updates, active_shared_updates, i, InvalidOid, local_map, RelMapping::mapfilenode, RelMapping::mapoid, RelMapFile::mappings, RelMapFile::num_mappings, and shared_map.

Referenced by RelidByRelfilenode().

213 {
214  const RelMapFile *map;
215  int32 i;
216 
217  /* If there are active updates, believe those over the main maps */
218  if (shared)
219  {
220  map = &active_shared_updates;
221  for (i = 0; i < map->num_mappings; i++)
222  {
223  if (filenode == map->mappings[i].mapfilenode)
224  return map->mappings[i].mapoid;
225  }
226  map = &shared_map;
227  for (i = 0; i < map->num_mappings; i++)
228  {
229  if (filenode == map->mappings[i].mapfilenode)
230  return map->mappings[i].mapoid;
231  }
232  }
233  else
234  {
235  map = &active_local_updates;
236  for (i = 0; i < map->num_mappings; i++)
237  {
238  if (filenode == map->mappings[i].mapfilenode)
239  return map->mappings[i].mapoid;
240  }
241  map = &local_map;
242  for (i = 0; i < map->num_mappings; i++)
243  {
244  if (filenode == map->mappings[i].mapfilenode)
245  return map->mappings[i].mapoid;
246  }
247  }
248 
249  return InvalidOid;
250 }
Oid mapoid
Definition: relmapper.c:81
static RelMapFile local_map
Definition: relmapper.c:110
signed int int32
Definition: c.h:346
static RelMapFile shared_map
Definition: relmapper.c:109
static RelMapFile active_local_updates
Definition: relmapper.c:129
RelMapping mappings[MAX_MAPPINGS]
Definition: relmapper.c:89
static RelMapFile active_shared_updates
Definition: relmapper.c:128
#define InvalidOid
Definition: postgres_ext.h:36
Oid mapfilenode
Definition: relmapper.c:82
int i
int32 num_mappings
Definition: relmapper.c:88

◆ RelationMapFinishBootstrap()

void RelationMapFinishBootstrap ( void  )

Definition at line 560 of file relmapper.c.

References Assert, DatabasePath, InvalidOid, IsBootstrapProcessingMode, MyDatabaseId, MyDatabaseTableSpace, RelMapFile::num_mappings, and write_relmap_file().

Referenced by BootstrapModeMain().

561 {
563 
564  /* Shouldn't be anything "pending" ... */
569 
570  /* Write the files; no WAL or sinval needed */
571  write_relmap_file(true, &shared_map, false, false, false,
572  InvalidOid, GLOBALTABLESPACE_OID, NULL);
573  write_relmap_file(false, &local_map, false, false, false,
575 }
static RelMapFile local_map
Definition: relmapper.c:110
static void write_relmap_file(bool shared, RelMapFile *newmap, bool write_wal, bool send_sinval, bool preserve_files, Oid dbid, Oid tsid, const char *dbpath)
Definition: relmapper.c:796
Oid MyDatabaseTableSpace
Definition: globals.c:87
static RelMapFile pending_shared_updates
Definition: relmapper.c:130
static RelMapFile shared_map
Definition: relmapper.c:109
static RelMapFile active_local_updates
Definition: relmapper.c:129
static RelMapFile pending_local_updates
Definition: relmapper.c:131
static RelMapFile active_shared_updates
Definition: relmapper.c:128
Oid MyDatabaseId
Definition: globals.c:85
#define InvalidOid
Definition: postgres_ext.h:36
char * DatabasePath
Definition: globals.c:93
#define Assert(condition)
Definition: c.h:732
#define IsBootstrapProcessingMode()
Definition: miscadmin.h:374
int32 num_mappings
Definition: relmapper.c:88

◆ RelationMapInitialize()

void RelationMapInitialize ( void  )

Definition at line 584 of file relmapper.c.

References RelMapFile::magic, and RelMapFile::num_mappings.

Referenced by RelationCacheInitialize().

585 {
586  /* The static variables should initialize to zeroes, but let's be sure */
587  shared_map.magic = 0; /* mark it not loaded */
588  local_map.magic = 0;
595 }
int32 magic
Definition: relmapper.c:87
static RelMapFile local_map
Definition: relmapper.c:110
static RelMapFile pending_shared_updates
Definition: relmapper.c:130
static RelMapFile shared_map
Definition: relmapper.c:109
static RelMapFile active_local_updates
Definition: relmapper.c:129
static RelMapFile pending_local_updates
Definition: relmapper.c:131
static RelMapFile active_shared_updates
Definition: relmapper.c:128
int32 num_mappings
Definition: relmapper.c:88

◆ RelationMapInitializePhase2()

void RelationMapInitializePhase2 ( void  )

Definition at line 604 of file relmapper.c.

References IsBootstrapProcessingMode, and load_relmap_file().

Referenced by RelationCacheInitializePhase2().

605 {
606  /*
607  * In bootstrap mode, the map file isn't there yet, so do nothing.
608  */
610  return;
611 
612  /*
613  * Load the shared map file, die on error.
614  */
615  load_relmap_file(true);
616 }
static void load_relmap_file(bool shared)
Definition: relmapper.c:698
#define IsBootstrapProcessingMode()
Definition: miscadmin.h:374

◆ RelationMapInitializePhase3()

void RelationMapInitializePhase3 ( void  )

Definition at line 625 of file relmapper.c.

References IsBootstrapProcessingMode, and load_relmap_file().

Referenced by RelationCacheInitializePhase3().

626 {
627  /*
628  * In bootstrap mode, the map file isn't there yet, so do nothing.
629  */
631  return;
632 
633  /*
634  * Load the local map file, die on error.
635  */
636  load_relmap_file(false);
637 }
static void load_relmap_file(bool shared)
Definition: relmapper.c:698
#define IsBootstrapProcessingMode()
Definition: miscadmin.h:374

◆ RelationMapInvalidate()

void RelationMapInvalidate ( bool  shared)

Definition at line 403 of file relmapper.c.

References load_relmap_file(), RelMapFile::magic, and RELMAPPER_FILEMAGIC.

Referenced by LocalExecuteInvalidationMessage().

404 {
405  if (shared)
406  {
408  load_relmap_file(true);
409  }
410  else
411  {
413  load_relmap_file(false);
414  }
415 }
int32 magic
Definition: relmapper.c:87
static RelMapFile local_map
Definition: relmapper.c:110
#define RELMAPPER_FILEMAGIC
Definition: relmapper.c:75
static RelMapFile shared_map
Definition: relmapper.c:109
static void load_relmap_file(bool shared)
Definition: relmapper.c:698

◆ RelationMapInvalidateAll()

void RelationMapInvalidateAll ( void  )

Definition at line 425 of file relmapper.c.

References load_relmap_file(), RelMapFile::magic, and RELMAPPER_FILEMAGIC.

Referenced by RelationCacheInvalidate().

426 {
428  load_relmap_file(true);
430  load_relmap_file(false);
431 }
int32 magic
Definition: relmapper.c:87
static RelMapFile local_map
Definition: relmapper.c:110
#define RELMAPPER_FILEMAGIC
Definition: relmapper.c:75
static RelMapFile shared_map
Definition: relmapper.c:109
static void load_relmap_file(bool shared)
Definition: relmapper.c:698

◆ RelationMapOidToFilenode()

Oid RelationMapOidToFilenode ( Oid  relationId,
bool  shared 
)

Definition at line 159 of file relmapper.c.

References active_local_updates, active_shared_updates, i, InvalidOid, local_map, RelMapping::mapfilenode, RelMapping::mapoid, RelMapFile::mappings, RelMapFile::num_mappings, and shared_map.

Referenced by pg_relation_filenode(), pg_relation_filepath(), RelationInitPhysicalAddr(), and swap_relation_files().

160 {
161  const RelMapFile *map;
162  int32 i;
163 
164  /* If there are active updates, believe those over the main maps */
165  if (shared)
166  {
167  map = &active_shared_updates;
168  for (i = 0; i < map->num_mappings; i++)
169  {
170  if (relationId == map->mappings[i].mapoid)
171  return map->mappings[i].mapfilenode;
172  }
173  map = &shared_map;
174  for (i = 0; i < map->num_mappings; i++)
175  {
176  if (relationId == map->mappings[i].mapoid)
177  return map->mappings[i].mapfilenode;
178  }
179  }
180  else
181  {
182  map = &active_local_updates;
183  for (i = 0; i < map->num_mappings; i++)
184  {
185  if (relationId == map->mappings[i].mapoid)
186  return map->mappings[i].mapfilenode;
187  }
188  map = &local_map;
189  for (i = 0; i < map->num_mappings; i++)
190  {
191  if (relationId == map->mappings[i].mapoid)
192  return map->mappings[i].mapfilenode;
193  }
194  }
195 
196  return InvalidOid;
197 }
Oid mapoid
Definition: relmapper.c:81
static RelMapFile local_map
Definition: relmapper.c:110
signed int int32
Definition: c.h:346
static RelMapFile shared_map
Definition: relmapper.c:109
static RelMapFile active_local_updates
Definition: relmapper.c:129
RelMapping mappings[MAX_MAPPINGS]
Definition: relmapper.c:89
static RelMapFile active_shared_updates
Definition: relmapper.c:128
#define InvalidOid
Definition: postgres_ext.h:36
Oid mapfilenode
Definition: relmapper.c:82
int i
int32 num_mappings
Definition: relmapper.c:88

◆ RelationMapRemoveMapping()

void RelationMapRemoveMapping ( Oid  relationId)

Definition at line 373 of file relmapper.c.

References active_local_updates, elog, ERROR, i, RelMapping::mapoid, RelMapFile::mappings, and RelMapFile::num_mappings.

Referenced by finish_heap_swap().

374 {
376  int32 i;
377 
378  for (i = 0; i < map->num_mappings; i++)
379  {
380  if (relationId == map->mappings[i].mapoid)
381  {
382  /* Found it, collapse it out */
383  map->mappings[i] = map->mappings[map->num_mappings - 1];
384  map->num_mappings--;
385  return;
386  }
387  }
388  elog(ERROR, "could not find temporary mapping for relation %u",
389  relationId);
390 }
Oid mapoid
Definition: relmapper.c:81
signed int int32
Definition: c.h:346
#define ERROR
Definition: elog.h:43
static RelMapFile active_local_updates
Definition: relmapper.c:129
RelMapping mappings[MAX_MAPPINGS]
Definition: relmapper.c:89
#define elog(elevel,...)
Definition: elog.h:226
int i
int32 num_mappings
Definition: relmapper.c:88

◆ RelationMapUpdateMap()

void RelationMapUpdateMap ( Oid  relationId,
Oid  fileNode,
bool  shared,
bool  immediate 
)

Definition at line 261 of file relmapper.c.

References active_local_updates, active_shared_updates, apply_map_update(), elog, ERROR, GetCurrentTransactionNestLevel(), IsBootstrapProcessingMode, IsInParallelMode(), local_map, pending_local_updates, pending_shared_updates, and shared_map.

Referenced by formrdesc(), RelationBuildLocalRelation(), RelationSetNewRelfilenode(), and swap_relation_files().

263 {
264  RelMapFile *map;
265 
267  {
268  /*
269  * In bootstrap mode, the mapping gets installed in permanent map.
270  */
271  if (shared)
272  map = &shared_map;
273  else
274  map = &local_map;
275  }
276  else
277  {
278  /*
279  * We don't currently support map changes within subtransactions, or
280  * when in parallel mode. This could be done with more bookkeeping
281  * infrastructure, but it doesn't presently seem worth it.
282  */
284  elog(ERROR, "cannot change relation mapping within subtransaction");
285 
286  if (IsInParallelMode())
287  elog(ERROR, "cannot change relation mapping in parallel mode");
288 
289  if (immediate)
290  {
291  /* Make it active, but only locally */
292  if (shared)
293  map = &active_shared_updates;
294  else
295  map = &active_local_updates;
296  }
297  else
298  {
299  /* Make it pending */
300  if (shared)
301  map = &pending_shared_updates;
302  else
303  map = &pending_local_updates;
304  }
305  }
306  apply_map_update(map, relationId, fileNode, true);
307 }
static RelMapFile local_map
Definition: relmapper.c:110
static RelMapFile pending_shared_updates
Definition: relmapper.c:130
bool IsInParallelMode(void)
Definition: xact.c:994
static RelMapFile shared_map
Definition: relmapper.c:109
#define ERROR
Definition: elog.h:43
static RelMapFile active_local_updates
Definition: relmapper.c:129
static RelMapFile pending_local_updates
Definition: relmapper.c:131
static RelMapFile active_shared_updates
Definition: relmapper.c:128
int GetCurrentTransactionNestLevel(void)
Definition: xact.c:842
#define IsBootstrapProcessingMode()
Definition: miscadmin.h:374
#define elog(elevel,...)
Definition: elog.h:226
static void apply_map_update(RelMapFile *map, Oid relationId, Oid fileNode, bool add_okay)
Definition: relmapper.c:319

◆ relmap_desc()

void relmap_desc ( StringInfo  buf,
XLogReaderState record 
)

Definition at line 20 of file relmapdesc.c.

References appendStringInfo(), xl_relmap_update::dbid, xl_relmap_update::nbytes, xl_relmap_update::tsid, XLOG_RELMAP_UPDATE, XLogRecGetData, XLogRecGetInfo, and XLR_INFO_MASK.

21 {
22  char *rec = XLogRecGetData(record);
23  uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
24 
25  if (info == XLOG_RELMAP_UPDATE)
26  {
27  xl_relmap_update *xlrec = (xl_relmap_update *) rec;
28 
29  appendStringInfo(buf, "database %u tablespace %u size %u",
30  xlrec->dbid, xlrec->tsid, xlrec->nbytes);
31  }
32 }
unsigned char uint8
Definition: c.h:356
#define XLogRecGetData(decoder)
Definition: xlogreader.h:246
void appendStringInfo(StringInfo str, const char *fmt,...)
Definition: stringinfo.c:78
#define XLogRecGetInfo(decoder)
Definition: xlogreader.h:242
#define XLOG_RELMAP_UPDATE
Definition: relmapper.h:25
#define XLR_INFO_MASK
Definition: xlogrecord.h:62

◆ relmap_identify()

const char* relmap_identify ( uint8  info)

Definition at line 35 of file relmapdesc.c.

References XLOG_RELMAP_UPDATE, and XLR_INFO_MASK.

36 {
37  const char *id = NULL;
38 
39  switch (info & ~XLR_INFO_MASK)
40  {
41  case XLOG_RELMAP_UPDATE:
42  id = "UPDATE";
43  break;
44  }
45 
46  return id;
47 }
#define XLOG_RELMAP_UPDATE
Definition: relmapper.h:25
#define XLR_INFO_MASK
Definition: xlogrecord.h:62

◆ relmap_redo()

void relmap_redo ( XLogReaderState record)

Definition at line 993 of file relmapper.c.

References Assert, xl_relmap_update::data, xl_relmap_update::dbid, elog, GetDatabasePath(), InvalidOid, xl_relmap_update::nbytes, PANIC, pfree(), xl_relmap_update::tsid, write_relmap_file(), XLOG_RELMAP_UPDATE, XLogRecGetData, XLogRecGetInfo, XLogRecHasAnyBlockRefs, and XLR_INFO_MASK.

994 {
995  uint8 info = XLogRecGetInfo(record) & ~XLR_INFO_MASK;
996 
997  /* Backup blocks are not used in relmap records */
998  Assert(!XLogRecHasAnyBlockRefs(record));
999 
1000  if (info == XLOG_RELMAP_UPDATE)
1001  {
1002  xl_relmap_update *xlrec = (xl_relmap_update *) XLogRecGetData(record);
1003  RelMapFile newmap;
1004  char *dbpath;
1005 
1006  if (xlrec->nbytes != sizeof(RelMapFile))
1007  elog(PANIC, "relmap_redo: wrong size %u in relmap update record",
1008  xlrec->nbytes);
1009  memcpy(&newmap, xlrec->data, sizeof(newmap));
1010 
1011  /* We need to construct the pathname for this database */
1012  dbpath = GetDatabasePath(xlrec->dbid, xlrec->tsid);
1013 
1014  /*
1015  * Write out the new map and send sinval, but of course don't write a
1016  * new WAL entry. There's no surrounding transaction to tell to
1017  * preserve files, either.
1018  *
1019  * There shouldn't be anyone else updating relmaps during WAL replay,
1020  * so we don't bother to take the RelationMappingLock. We would need
1021  * to do so if load_relmap_file needed to interlock against writers.
1022  */
1023  write_relmap_file((xlrec->dbid == InvalidOid), &newmap,
1024  false, true, false,
1025  xlrec->dbid, xlrec->tsid, dbpath);
1026 
1027  pfree(dbpath);
1028  }
1029  else
1030  elog(PANIC, "relmap_redo: unknown op code %u", info);
1031 }
unsigned char uint8
Definition: c.h:356
static void write_relmap_file(bool shared, RelMapFile *newmap, bool write_wal, bool send_sinval, bool preserve_files, Oid dbid, Oid tsid, const char *dbpath)
Definition: relmapper.c:796
#define PANIC
Definition: elog.h:53
void pfree(void *pointer)
Definition: mcxt.c:1056
#define XLogRecGetData(decoder)
Definition: xlogreader.h:246
#define XLogRecGetInfo(decoder)
Definition: xlogreader.h:242
char * GetDatabasePath(Oid dbNode, Oid spcNode)
Definition: relpath.c:107
#define XLOG_RELMAP_UPDATE
Definition: relmapper.h:25
#define InvalidOid
Definition: postgres_ext.h:36
#define Assert(condition)
Definition: c.h:732
#define XLR_INFO_MASK
Definition: xlogrecord.h:62
#define elog(elevel,...)
Definition: elog.h:226
#define XLogRecHasAnyBlockRefs(decoder)
Definition: xlogreader.h:248
char data[FLEXIBLE_ARRAY_MEMBER]
Definition: relmapper.h:32

◆ RestoreRelationMap()

void RestoreRelationMap ( char *  startAddress)

Definition at line 674 of file relmapper.c.

References SerializedActiveRelMaps::active_local_updates, SerializedActiveRelMaps::active_shared_updates, elog, ERROR, and RelMapFile::num_mappings.

Referenced by ParallelWorkerMain().

675 {
676  SerializedActiveRelMaps *relmaps;
677 
682  elog(ERROR, "parallel worker has existing mappings");
683 
684  relmaps = (SerializedActiveRelMaps *) startAddress;
687 }
static RelMapFile pending_shared_updates
Definition: relmapper.c:130
#define ERROR
Definition: elog.h:43
static RelMapFile active_local_updates
Definition: relmapper.c:129
static RelMapFile pending_local_updates
Definition: relmapper.c:131
static RelMapFile active_shared_updates
Definition: relmapper.c:128
RelMapFile active_shared_updates
Definition: relmapper.c:100
#define elog(elevel,...)
Definition: elog.h:226
RelMapFile active_local_updates
Definition: relmapper.c:101
int32 num_mappings
Definition: relmapper.c:88

◆ SerializeRelationMap()

void SerializeRelationMap ( Size  maxSize,
char *  startAddress 
)

Definition at line 657 of file relmapper.c.

References SerializedActiveRelMaps::active_local_updates, active_local_updates, SerializedActiveRelMaps::active_shared_updates, active_shared_updates, Assert, and EstimateRelationMapSpace().

Referenced by InitializeParallelDSM().

658 {
659  SerializedActiveRelMaps *relmaps;
660 
661  Assert(maxSize >= EstimateRelationMapSpace());
662 
663  relmaps = (SerializedActiveRelMaps *) startAddress;
666 }
static RelMapFile active_local_updates
Definition: relmapper.c:129
static RelMapFile active_shared_updates
Definition: relmapper.c:128
RelMapFile active_shared_updates
Definition: relmapper.c:100
#define Assert(condition)
Definition: c.h:732
Size EstimateRelationMapSpace(void)
Definition: relmapper.c:646
RelMapFile active_local_updates
Definition: relmapper.c:101