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

Commit0bec1d3

Browse files
kvapkelvich
authored andcommitted
Add a check that Raft is configured into the set-get-cas functions.
1 parentba886d5 commit0bec1d3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎multimaster.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2375,6 +2375,9 @@ void* RaftableGet(char const* key, int* size, RaftableTimestamp* ts, bool nowait
23752375
{
23762376
size_ts;
23772377
char*value;
2378+
2379+
if (!MtmUseRaftable)returnNULL;
2380+
23782381
Assert(ts==NULL);/* not implemented */
23792382
value=raftable_get(key,&s);
23802383
*size=s;
@@ -2383,11 +2386,15 @@ void* RaftableGet(char const* key, int* size, RaftableTimestamp* ts, bool nowait
23832386

23842387
voidRaftableSet(charconst*key,voidconst*value,intsize,boolnowait)
23852388
{
2389+
if (!MtmUseRaftable)return;
2390+
23862391
raftable_set(key,value,size,nowait ?0 :-1);
23872392
}
23882393

23892394
boolRaftableCAS(charconst*key,charconst*value,boolnowait)
23902395
{
2396+
if (!MtmUseRaftable)return false;
2397+
23912398
Assert(false);/* not implemented */
23922399
return false;
23932400
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp