Skip to content

Commit

Permalink
Renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
emelsimsek committed Sep 4, 2023
1 parent b4a1716 commit be0aeca
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/backend/distributed/metadata/metadata_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,26 +134,26 @@ typedef struct ShardIdCacheEntry
} ShardIdCacheEntry;

/*
* ExtensionCreateState is used to track if citus extension has been created
* ExtensionCreatedState is used to track if citus extension has been created
* using CREATE EXTENSION command.
* UNKNOWN : MetadataCache hence extensionCreated value is invalid.
* UNKNOWN : MetadataCache is invalid. State is UNKNOWN.
* CREATED : Citus is created.
* NOTCREATED : Citus is either not created or dropped.
* NOTCREATED : Citus is not created.
*/
typedef enum ExtensionCreateState
typedef enum ExtensionCreatedState
{
UNKNOWN = 0,
CREATED = 1,
NOTCREATED = 2,
} ExtensionCreateState;
} ExtensionCreatedState;

/*
* State which should be cleared upon DROP EXTENSION. When the configuration
* changes, e.g. because extension is dropped, these summarily get set to 0.
*/
typedef struct MetadataCacheData
{
ExtensionCreateState extensionCreated;
ExtensionCreatedState extensionCreatedState;
Oid distShardRelationId;
Oid distPlacementRelationId;
Oid distBackgroundJobRelationId;
Expand Down Expand Up @@ -2213,11 +2213,11 @@ CitusHasBeenLoaded(void)
}

/*
* If extensionCreated is UNKNOWN, query pg_extension for Citus
* and cache the result.
* Otherwise return the value extensionCreated indicates.
* If extensionCreatedState is UNKNOWN, query pg_extension for Citus
* and cache the result. Otherwise return the value extensionCreatedState
* indicates.
*/
if (MetadataCache.extensionCreated == UNKNOWN)
if (MetadataCache.extensionCreatedState == UNKNOWN)
{
bool extensionCreated = CitusHasBeenLoadedInternal();

Expand All @@ -2240,15 +2240,15 @@ CitusHasBeenLoaded(void)
*/
DistColocationRelationId();

MetadataCache.extensionCreated = CREATED;
MetadataCache.extensionCreatedState = CREATED;
}
else
{
MetadataCache.extensionCreated = NOTCREATED;
MetadataCache.extensionCreatedState = NOTCREATED;
}
}

return (MetadataCache.extensionCreated == CREATED) ? true : false;
return (MetadataCache.extensionCreatedState == CREATED) ? true : false;
}


Expand Down Expand Up @@ -4947,8 +4947,8 @@ CreateDistObjectCache(void)


/*
* InvalidateMetadataSystemCache resets all the cached OIDs and the isExtensionCreated flag,
* and invalidates the worker node, ConnParams, and local group ID caches.
* InvalidateMetadataSystemCache resets all the cached OIDs and the extensionCreatedState
* flag and invalidates the worker node, ConnParams, and local group ID caches.
*/
void
InvalidateMetadataSystemCache(void)
Expand Down

0 comments on commit be0aeca

Please sign in to comment.