We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parentdae55b4 commit9b0e4c8Copy full SHA for 9b0e4c8
contrib/raftable/Makefile
@@ -1,19 +1,19 @@
1
MODULE_big = raftable
2
-OBJS = raftable.o worker.o state.o blockmem.o
+OBJS = raftable.o worker.o state.o blockmem.o raft/obj/raft.o raft/obj/util.o
3
EXTENSION = raftable
4
DATA = raftable--1.0.sql
5
6
-raftable.so: raft/lib/libraft.a
+.PHONY: all
7
8
-raft/lib/libraft.a:
9
-make -C raft
+all: raftable.so
+
10
+raft/obj/raft.oraft/obj/util.o:
11
+make -C raft obj/raft.o obj/util.o
12
13
EXTRA_INSTALL = contrib/raftable
14
-RAFT_PREFIX = raft
-overrideLDFLAGS += -L$(RAFT_PREFIX)/lib -Wl,-whole-archive -lraft -Wl,-no-whole-archive
15
-overrideCFLAGS += -Wfatal-errors
16
-overrideCPPFLAGS += -I$(RAFT_PREFIX)/include
+overrideCFLAGS += -Wfatal-errors -Wall
+overrideCPPFLAGS += -Iraft/include
17
18
ifdefUSE_PGXS
19
PG_CONFIG = pg_config
contrib/raftable/README
@@ -4,12 +4,6 @@ Raftable
This extension allows you to have a key-value table replicated between several
Postgres instances over Raft protocol.
-Depends on
-----------
-
-Raft implementation in C: https://github.com/kvap/raft
-Please compile the raft library with -fpic flag.
Internals
---------
contrib/raftable/blockmem.c
@@ -32,8 +32,6 @@ typedef struct block_t
32
int
33
blockmem_format(void*origin,size_tsize)
34
{
35
-block_t*block;
36
-meta_t*meta;
37
intid;
38
intblocks= (size-1) /BLOCK_LEN;
39
if (blocks <=0)return0;
contrib/raftable/raftable.c
@@ -160,7 +160,6 @@ char *raftable_get(const char *key, size_t *len)
160
Datum
161
raftable_sql_get(PG_FUNCTION_ARGS)
162
163
-RaftableEntry*e;
164
RaftableKeykey;
165
size_tlen;
166
text_to_cstring_buffer(PG_GETARG_TEXT_P(0),key.data,sizeof(key.data));
@@ -178,16 +177,6 @@ raftable_sql_get(PG_FUNCTION_ARGS)
178
177
PG_RETURN_NULL();
179
}
180
181
-staticvoidstart_timer(TimestampTz*timer)
182
-{
183
-*timer-=GetCurrentTimestamp();
184
-}
185
186
-staticvoidstop_timer(TimestampTz*timer)
187
188
-*timer+=GetCurrentTimestamp();
189
190
191
staticlongmsec(TimestampTztimer)
192
193
longsec;
contrib/raftable/state.c
@@ -264,7 +264,6 @@ StateP state_shmem_init()
264
info.keysize=sizeof(RaftableKey);
265
info.entrysize=sizeof(RaftableEntry);
266
boolfound;
267
-inti;
268
269
state=ShmemInitStruct(
270
"raftable_state",
contrib/raftable/worker.c
@@ -131,7 +131,6 @@ static bool add_socket(int sock)
131
staticbooladd_client(intsock)
132
133
inti;
134
-Client*c=server.clients;
135
136
if (server.clientnum >=MAX_CLIENTS)
137
@@ -165,7 +164,6 @@ static bool remove_socket(int sock)
staticboolremove_client(Client*c)
167
168
-inti=0;
169
intsock=c->sock;
170
Assert(sock >=0);
171
c->sock=-1;
@@ -309,7 +307,7 @@ static void attend(Client *c)
309
307
310
308
311
312
-staticboolnotify(void)
+staticvoidnotify(void)
313
314
inti=0;
315
for (i=0;i<MAX_CLIENTS;i++)
@@ -343,7 +341,6 @@ static void drop_bads(void)
343
341
344
342
staticbooltick(inttimeout_ms)
345
346
347
intnumready;
348
boolraft_ready= false;
349