Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0bec1d3

Browse files
kvapkelvich
authored andcommitted
Add a check that Raft is configured into the set-get-cas functions.
1 parent ba886d5 commit 0bec1d3

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_t s;
23772377
char *value;
2378+
2379+
if (!MtmUseRaftable) return NULL;
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
void RaftableSet(char const* key, void const* value, int size, bool nowait)
23852388
{
2389+
if (!MtmUseRaftable) return;
2390+
23862391
raftable_set(key, value, size, nowait ? 0 : -1);
23872392
}
23882393

23892394
bool RaftableCAS(char const* key, char const* value, bool nowait)
23902395
{
2396+
if (!MtmUseRaftable) return false;
2397+
23912398
Assert(false); /* not implemented */
23922399
return false;
23932400
}

0 commit comments

Comments
 (0)