Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0d82adc

Browse files
committed
Fix conflicting raftable header names. Remove raftable.o from Makefile.
1 parent86ef2cd commit0d82adc

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

‎contrib/mmts/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
MODULE_big = multimaster
2-
OBJS = multimaster.oraftable.oarbiter.o bytebuf.o bgwpool.o pglogical_output.o pglogical_proto.o pglogical_receiver.o pglogical_apply.o pglogical_hooks.o pglogical_config.o ddd.o bkb.o
2+
OBJS = multimaster.o arbiter.o bytebuf.o bgwpool.o pglogical_output.o pglogical_proto.o pglogical_receiver.o pglogical_apply.o pglogical_hooks.o pglogical_config.o ddd.o bkb.o
33

44
overrideCPPFLAGS += -I../raftable
55

‎contrib/mmts/multimaster.c‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555
#include"catalog/indexing.h"
5656
#include"pglogical_output/hooks.h"
5757

58-
#include"raftable.h"
5958
#include"multimaster.h"
6059
#include"ddd.h"
60+
#include"raftable_wrapper.h"
6161
#include"raftable.h"
6262

6363
typedefstruct {
@@ -2372,3 +2372,24 @@ MtmDetectGlobalDeadLock(PGPROC* proc)
23722372
}
23732373
returnhasDeadlock;
23742374
}
2375+
2376+
void*RaftableGet(charconst*key,int*size,RaftableTimestamp*ts,boolnowait)
2377+
{
2378+
size_ts;
2379+
char*value;
2380+
Assert(ts==NULL);/* not implemented */
2381+
value=raftable_get(key,&s);
2382+
*size=s;
2383+
returnvalue;
2384+
}
2385+
2386+
voidRaftableSet(charconst*key,voidconst*value,intsize,boolnowait)
2387+
{
2388+
raftable_set(key,value,size,nowait ?0 :-1);
2389+
}
2390+
2391+
boolRaftableCAS(charconst*key,charconst*value,boolnowait)
2392+
{
2393+
Assert(false);/* not implemented */
2394+
return false;
2395+
}

‎contrib/mmts/raftable.h‎renamed to ‎contrib/mmts/raftable_wrapper.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef__RAFTABLE_H__
2-
#define__RAFTABLE_H__
1+
#ifndef__RAFTABLE_WRAPPER_H__
2+
#define__RAFTABLE_WRAPPER_H__
33

44
typedefstructRaftableTimestamp {
55
time_ttime;/* local time at master */

‎contrib/raftable/state.c‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@ typedef struct State {
1818

1919
staticchar*state_get_string(StatePstate,RaftableEntry*e,size_t*len)
2020
{
21-
size_tchecklen;
21+
size_tactlen;
2222
char*s;
2323
Assert(state);
2424
Assert(LWLockHeldByMe(state->lock));
2525

26-
*len=blockmem_len(state->blockmem,e->block);
27-
Assert(len>0);
28-
s=palloc(*len);
29-
checklen=blockmem_get(state->blockmem,e->block,s,*len);
30-
Assert(*len==checklen);
26+
actlen=blockmem_len(state->blockmem,e->block);
27+
if (len)*len=actlen;
28+
Assert(actlen>0);
29+
s=palloc(actlen);
30+
actlen-=blockmem_get(state->blockmem,e->block,s,actlen);
31+
Assert(actlen==0);
3132

3233
returns;
3334
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp