Skip to content

Commit

Permalink
disable rpoplpush when cache&list is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
cheniujh committed Dec 3, 2024
1 parent 7c155a5 commit c074f88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/pika_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ class PikaConf : public pstd::BaseConf {
int64_t min_blob_size_ = 4096; // 4K
int64_t blob_cache_ = 0;
int64_t blob_num_shard_bits_ = 0;
int64_t blob_file_size_ = 256 * 1024 * 1024; // 256M
int64_t blob_file_size_ = 256 << 20; // 256M
std::string blob_compression_type_ = "none";

std::shared_mutex rwlock_;
Expand Down
6 changes: 4 additions & 2 deletions src/pika_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@
#include <utility>
#include "include/pika_cache.h"
#include "include/pika_data_distribution.h"
#include "include/pika_rm.h"
#include "include/pika_server.h"
#include "include/pika_slot_command.h"
#include "pstd/include/pstd_string.h"
#include "scope_record_lock.h"

extern PikaServer* g_pika_server;
extern std::unique_ptr<PikaReplicaManager> g_pika_rm;

void LIndexCmd::DoInitial() {
if (!CheckArg(argv_.size())) {
Expand Down Expand Up @@ -786,6 +784,10 @@ void RPopCmd::DoUpdateCache() {
}

void RPopLPushCmd::DoInitial() {
if (PIKA_CACHE_NONE != g_pika_conf->cache_mode() && g_pika_conf->GetCacheList()) {
res_.SetRes(CmdRes::kErrOther, "the command is not supported when cache&list is enabled");
return;
}
if (!CheckArg(argv_.size())) {
res_.SetRes(CmdRes::kWrongNum, kCmdNameRPopLPush);
return;
Expand Down

0 comments on commit c074f88

Please sign in to comment.