Skip to content

Commit 1deed76

Browse files
committed
Add a check that Raft is configured into the set-get-cas functions.
1 parent fbf21c9 commit 1deed76

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

contrib/mmts/multimaster.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2377,6 +2377,9 @@ void* RaftableGet(char const* key, int* size, RaftableTimestamp* ts, bool nowait
23772377
{
23782378
size_t s;
23792379
char *value;
2380+
2381+
if (!MtmUseRaftable) return NULL;
2382+
23802383
Assert(ts == NULL); /* not implemented */
23812384
value = raftable_get(key, &s);
23822385
*size = s;
@@ -2385,11 +2388,15 @@ void* RaftableGet(char const* key, int* size, RaftableTimestamp* ts, bool nowait
23852388

23862389
void RaftableSet(char const* key, void const* value, int size, bool nowait)
23872390
{
2391+
if (!MtmUseRaftable) return;
2392+
23882393
raftable_set(key, value, size, nowait ? 0 : -1);
23892394
}
23902395

23912396
bool RaftableCAS(char const* key, char const* value, bool nowait)
23922397
{
2398+
if (!MtmUseRaftable) return false;
2399+
23932400
Assert(false); /* not implemented */
23942401
return false;
23952402
}

0 commit comments

Comments
 (0)