mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-06 13:02:55 +00:00
Mark some variables 'static'
Move initialization of neon_redo_read_buffer_filter. This allows marking it 'static', too.
This commit is contained in:
@@ -17,7 +17,6 @@
|
|||||||
#include "pagestore_client.h"
|
#include "pagestore_client.h"
|
||||||
#include "fmgr.h"
|
#include "fmgr.h"
|
||||||
#include "access/xlog.h"
|
#include "access/xlog.h"
|
||||||
#include "access/xlogutils.h"
|
|
||||||
#include "storage/buf_internals.h"
|
#include "storage/buf_internals.h"
|
||||||
#include "storage/lwlock.h"
|
#include "storage/lwlock.h"
|
||||||
#include "storage/ipc.h"
|
#include "storage/ipc.h"
|
||||||
@@ -62,8 +61,8 @@ char *neon_auth_token;
|
|||||||
int readahead_buffer_size = 128;
|
int readahead_buffer_size = 128;
|
||||||
int flush_every_n_requests = 8;
|
int flush_every_n_requests = 8;
|
||||||
|
|
||||||
int n_reconnect_attempts = 0;
|
static int n_reconnect_attempts = 0;
|
||||||
int max_reconnect_attempts = 60;
|
static int max_reconnect_attempts = 60;
|
||||||
|
|
||||||
#define MAX_PAGESERVER_CONNSTRING_SIZE 256
|
#define MAX_PAGESERVER_CONNSTRING_SIZE 256
|
||||||
|
|
||||||
@@ -83,8 +82,6 @@ static PagestoreShmemState *pagestore_shared;
|
|||||||
static uint64 pagestore_local_counter = 0;
|
static uint64 pagestore_local_counter = 0;
|
||||||
static char local_pageserver_connstring[MAX_PAGESERVER_CONNSTRING_SIZE];
|
static char local_pageserver_connstring[MAX_PAGESERVER_CONNSTRING_SIZE];
|
||||||
|
|
||||||
bool (*old_redo_read_buffer_filter) (XLogReaderState *record, uint8 block_id) = NULL;
|
|
||||||
|
|
||||||
static bool pageserver_flush(void);
|
static bool pageserver_flush(void);
|
||||||
static void pageserver_disconnect(void);
|
static void pageserver_disconnect(void);
|
||||||
|
|
||||||
@@ -627,8 +624,6 @@ pg_init_libpagestore(void)
|
|||||||
smgr_hook = smgr_neon;
|
smgr_hook = smgr_neon;
|
||||||
smgr_init_hook = smgr_init_neon;
|
smgr_init_hook = smgr_init_neon;
|
||||||
dbsize_hook = neon_dbsize;
|
dbsize_hook = neon_dbsize;
|
||||||
old_redo_read_buffer_filter = redo_read_buffer_filter;
|
|
||||||
redo_read_buffer_filter = neon_redo_read_buffer_filter;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lfc_init();
|
lfc_init();
|
||||||
|
|||||||
@@ -27,13 +27,6 @@ extern void pg_init_walproposer(void);
|
|||||||
|
|
||||||
extern void pg_init_extension_server(void);
|
extern void pg_init_extension_server(void);
|
||||||
|
|
||||||
/*
|
|
||||||
* Returns true if we shouldn't do REDO on that block in record indicated by
|
|
||||||
* block_id; false otherwise.
|
|
||||||
*/
|
|
||||||
extern bool neon_redo_read_buffer_filter(XLogReaderState *record, uint8 block_id);
|
|
||||||
extern bool (*old_redo_read_buffer_filter) (XLogReaderState *record, uint8 block_id);
|
|
||||||
|
|
||||||
extern uint64 BackpressureThrottlingTime(void);
|
extern uint64 BackpressureThrottlingTime(void);
|
||||||
extern void replication_feedback_get_lsns(XLogRecPtr *writeLsn, XLogRecPtr *flushLsn, XLogRecPtr *applyLsn);
|
extern void replication_feedback_get_lsns(XLogRecPtr *writeLsn, XLogRecPtr *flushLsn, XLogRecPtr *applyLsn);
|
||||||
|
|
||||||
|
|||||||
@@ -47,9 +47,10 @@
|
|||||||
|
|
||||||
#include "access/xact.h"
|
#include "access/xact.h"
|
||||||
#include "access/xlog.h"
|
#include "access/xlog.h"
|
||||||
|
#include "access/xlogdefs.h"
|
||||||
#include "access/xloginsert.h"
|
#include "access/xloginsert.h"
|
||||||
#include "access/xlog_internal.h"
|
#include "access/xlog_internal.h"
|
||||||
#include "access/xlogdefs.h"
|
#include "access/xlogutils.h"
|
||||||
#include "catalog/pg_class.h"
|
#include "catalog/pg_class.h"
|
||||||
#include "common/hashfn.h"
|
#include "common/hashfn.h"
|
||||||
#include "executor/instrument.h"
|
#include "executor/instrument.h"
|
||||||
@@ -106,6 +107,9 @@ typedef enum
|
|||||||
static SMgrRelation unlogged_build_rel = NULL;
|
static SMgrRelation unlogged_build_rel = NULL;
|
||||||
static UnloggedBuildPhase unlogged_build_phase = UNLOGGED_BUILD_NOT_IN_PROGRESS;
|
static UnloggedBuildPhase unlogged_build_phase = UNLOGGED_BUILD_NOT_IN_PROGRESS;
|
||||||
|
|
||||||
|
static bool neon_redo_read_buffer_filter(XLogReaderState *record, uint8 block_id);
|
||||||
|
static bool (*old_redo_read_buffer_filter) (XLogReaderState *record, uint8 block_id) = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prefetch implementation:
|
* Prefetch implementation:
|
||||||
*
|
*
|
||||||
@@ -239,7 +243,7 @@ typedef struct PrefetchState
|
|||||||
PrefetchRequest prf_buffer[]; /* prefetch buffers */
|
PrefetchRequest prf_buffer[]; /* prefetch buffers */
|
||||||
} PrefetchState;
|
} PrefetchState;
|
||||||
|
|
||||||
PrefetchState *MyPState;
|
static PrefetchState *MyPState;
|
||||||
|
|
||||||
#define GetPrfSlot(ring_index) ( \
|
#define GetPrfSlot(ring_index) ( \
|
||||||
( \
|
( \
|
||||||
@@ -257,7 +261,7 @@ PrefetchState *MyPState;
|
|||||||
) \
|
) \
|
||||||
)
|
)
|
||||||
|
|
||||||
XLogRecPtr prefetch_lsn = 0;
|
static XLogRecPtr prefetch_lsn = 0;
|
||||||
|
|
||||||
static bool compact_prefetch_buffers(void);
|
static bool compact_prefetch_buffers(void);
|
||||||
static void consume_prefetch_responses(void);
|
static void consume_prefetch_responses(void);
|
||||||
@@ -1371,6 +1375,9 @@ neon_init(void)
|
|||||||
MyPState->prf_hash = prfh_create(MyPState->hashctx,
|
MyPState->prf_hash = prfh_create(MyPState->hashctx,
|
||||||
readahead_buffer_size, NULL);
|
readahead_buffer_size, NULL);
|
||||||
|
|
||||||
|
old_redo_read_buffer_filter = redo_read_buffer_filter;
|
||||||
|
redo_read_buffer_filter = neon_redo_read_buffer_filter;
|
||||||
|
|
||||||
#ifdef DEBUG_COMPARE_LOCAL
|
#ifdef DEBUG_COMPARE_LOCAL
|
||||||
mdinit();
|
mdinit();
|
||||||
#endif
|
#endif
|
||||||
@@ -2869,7 +2876,7 @@ get_fsm_physical_block(BlockNumber heapblk)
|
|||||||
* contents, where with REDO locking it would wait on block 1 and see
|
* contents, where with REDO locking it would wait on block 1 and see
|
||||||
* block 3 with post-REDO contents only.
|
* block 3 with post-REDO contents only.
|
||||||
*/
|
*/
|
||||||
bool
|
static bool
|
||||||
neon_redo_read_buffer_filter(XLogReaderState *record, uint8 block_id)
|
neon_redo_read_buffer_filter(XLogReaderState *record, uint8 block_id)
|
||||||
{
|
{
|
||||||
XLogRecPtr end_recptr = record->EndRecPtr;
|
XLogRecPtr end_recptr = record->EndRecPtr;
|
||||||
|
|||||||
Reference in New Issue
Block a user