-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathspock_exception_handler.h
78 lines (62 loc) · 1.73 KB
/
spock_exception_handler.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include "postgres.h"
#include "miscadmin.h"
#include "libpq/libpq-be.h"
#include "access/commit_ts.h"
#include "access/xact.h"
#include "commands/dbcommands.h"
#include "common/hashfn.h"
#include "catalog/dependency.h"
#include "catalog/indexing.h"
#include "catalog/pg_type.h"
#include "nodes/makefuncs.h"
#include "postmaster/interrupt.h"
#include "storage/ipc.h"
#include "storage/proc.h"
#include "storage/procsignal.h"
#include "storage/procarray.h"
#include "utils/guc.h"
#include "utils/memutils.h"
#include "utils/timestamp.h"
#include "utils/lsyscache.h"
#include "utils/syscache.h"
#include "utils/builtins.h"
#include "replication/origin.h"
#include "replication/slot.h"
#include "pgstat.h"
#include "spock_sync.h"
#include "spock_worker.h"
#include "spock_conflict.h"
#include "spock_relcache.h"
typedef struct SpockExceptionLog
{
NameData slot_name;
XLogRecPtr commit_lsn;
HeapTuple local_tuple;
} SpockExceptionLog;
typedef enum SpockExceptionBehaviour
{
DISCARD,
TRANSDISCARD
} SpockExceptionBehaviour;
typedef enum SpockExceptionLogging
{
LOG_NONE,
LOG_DISCARD,
LOG_ALL
} SpockExceptionLogging;
extern SpockExceptionLog *exception_log_ptr;
extern int exception_behaviour;
extern int exception_logging;
extern int exception_command_counter;
extern void add_entry_to_exception_log(Oid remote_origin,
TimestampTz remote_commit_ts,
TransactionId remote_xid,
Oid local_origin,
TimestampTz local_commit_ts,
SpockRelation *targetrel,
HeapTuple localtup,
SpockTupleData *remoteoldtup,
SpockTupleData *remotenewtup,
char *ddl_statement, char *ddl_user,
char *operation,
char *error_message);