Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
brother-jin committed Jan 23, 2024
1 parent 733bcf2 commit c5d7b96
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pika.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ jobs:
- name: Install Deps
run: |
brew update
brew install --overwrite python autoconf protobuf llvm wget git
brew install --overwrite autoconf protobuf llvm wget git
brew install gcc@10 automake cmake make binutils
- name: Configure CMake
Expand Down
1 change: 1 addition & 0 deletions include/pika_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ class PikaConf : public pstd::BaseConf {
}

const std::string scache_type() {
std::lock_guard l(rwlock_);
return pstd::StringConcat(cache_type_, COMMA);
}

Expand Down
2 changes: 1 addition & 1 deletion src/pika_admin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3127,7 +3127,7 @@ void DisableWalCmd::Do() {
}

void CacheCmd::DoInitial() {
if (!CheckArg(argv_.size()) || argv_.size() < 2) {
if (!CheckArg(argv_.size()) || (argv_.size() > 3)) {
res_.SetRes(CmdRes::kWrongNum, kCmdNameCache);
return;
}
Expand Down
2 changes: 0 additions & 2 deletions src/pika_command.cc
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,6 @@ void Cmd::Execute() {
}

void Cmd::ProcessCommand(const HintKeys& hint_keys) {
LOG(INFO) << "lmz";
if (stage_ == kNone) {
InternalProcessCommand(hint_keys);
} else {
Expand All @@ -868,7 +867,6 @@ void Cmd::ProcessCommand(const HintKeys& hint_keys) {
}

void Cmd::InternalProcessCommand(const HintKeys& hint_keys) {
LOG(INFO) << db_->GetDBName();
pstd::lock::MultiRecordLock record_lock(db_->LockMgr());
if (is_write()) {
record_lock.Lock(current_key());
Expand Down
3 changes: 1 addition & 2 deletions src/pika_conf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ void PikaConf::SetCacheType(const std::string& value) {

int PikaConf::ConfigRewrite() {
// std::string userblacklist = suser_blacklist();

SetConfStr("cache-type", scache_type());
std::lock_guard l(rwlock_);
// Only set value for config item that can be config set.
SetConfInt("timeout", timeout_);
Expand Down Expand Up @@ -669,7 +669,6 @@ int PikaConf::ConfigRewrite() {
SetConfStr("share-block-cache", share_block_cache_ ? "yes" : "no");
SetConfInt("block-size", block_size_);
SetConfInt("block-cache", block_cache_);
SetConfStr("cache-type", scache_type());
SetConfStr("cache-index-and-filter-blocks", cache_index_and_filter_blocks_ ? "yes" : "no");
SetConfInt("cache-model", cache_model_);
SetConfInt("zset_cache_start_pos", zset_cache_start_pos_);
Expand Down
5 changes: 3 additions & 2 deletions src/pika_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,7 @@ void PikaServer::ResetCacheAsync(uint32_t cache_num, std::shared_ptr<DB> db, cac
}
}

void PikaServer::ClearCacheDbAsync(std::shared_ptr<Slot> slot) {
void PikaServer::ClearCacheDbAsync(std::shared_ptr<DB> db) {
// disable cache temporarily, and restore it after cache cleared
g_pika_conf->SetCacheDisableFlag();
if (PIKA_CACHE_STATUS_OK != db->cache()->CacheStatus()) {
Expand Down Expand Up @@ -1808,7 +1808,7 @@ void PikaServer::ClearHitRatio(std::shared_ptr<DB> db) {
db->cache()->ClearHitRatio();
}

void PikaServer::OnCacheStartPosChanged(int zset_cache_start_pos, std::shared_ptr<Slot> slot) {
void PikaServer::OnCacheStartPosChanged(int zset_cache_start_pos, std::shared_ptr<DB> db) {
ResetCacheConfig(db);
ClearCacheDbAsync(db);
}
Expand All @@ -1823,6 +1823,7 @@ void PikaServer::ClearCacheDbAsyncV2(std::shared_ptr<DB> db) {
BGCacheTaskArg *arg = new BGCacheTaskArg();
arg->db = db;
arg->task_type = CACHE_BGTASK_CLEAR;
arg->conf = std::move(g_pika_conf);
arg->reenable_cache = true;
common_bg_thread_.Schedule(&DoCacheBGTask, static_cast<void*>(arg));
}
Expand Down

0 comments on commit c5d7b96

Please sign in to comment.