-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbdr_locks.h
43 lines (37 loc) · 1.49 KB
/
bdr_locks.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* bdr_locks.h
*
* BiDirectionalReplication
*
* Copyright (c) 2014-2015, PostgreSQL Global Development Group
*
* bdr_locks.h
*/
#ifndef BDR_LOCKS_H
#define BDR_LOCKS_H
typedef enum BDRLockType
{
BDR_LOCK_NOLOCK = 0, /* no lock (not used) */
BDR_LOCK_DDL = 1, /* lock against DDL */
BDR_LOCK_WRITE = 2 /* lock against any write */
} BDRLockType;
void bdr_locks_startup(void);
void bdr_locks_set_nnodes(int nnodes);
void bdr_acquire_ddl_lock(BDRLockType lock_type);
void bdr_process_acquire_ddl_lock(const BDRNodeId * const node,
BDRLockType lock_type);
void bdr_process_release_ddl_lock(const BDRNodeId * const origin, const BDRNodeId * const lock);
void bdr_process_confirm_ddl_lock(const BDRNodeId * const origin, const BDRNodeId * const lock,
BDRLockType lock_type);
void bdr_process_decline_ddl_lock(const BDRNodeId * const origin, const BDRNodeId * const lock,
BDRLockType lock_type);
void bdr_process_request_replay_confirm(const BDRNodeId * const node, XLogRecPtr lsn);
void bdr_process_replay_confirm(const BDRNodeId * const node, XLogRecPtr lsn);
void bdr_locks_process_remote_startup(const BDRNodeId * const node);
extern bool bdr_locks_process_message(int msg_type, bool transactional,
XLogRecPtr lsn, const BDRNodeId * const origin,
StringInfo message);
extern char * bdr_lock_type_to_name(BDRLockType lock_type);
extern BDRLockType bdr_lock_name_to_type(const char *lock_type);
extern void bdr_locks_node_parted(BDRNodeId *node);
#endif