Skip to content

Commit

Permalink
fix: slot migrate cannot operate the same name of different datatypes (
Browse files Browse the repository at this point in the history
…OpenAtomFoundation#141)

* fix: slot migrate cannot operate the same name of different datatypes

* use glog(google) by default

* update travis & Dockerfile
  • Loading branch information
fancy-rabbit authored and KernelMaker committed Aug 8, 2017
1 parent 4d83c3a commit 6527105
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/pika_slot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ static int kvGet(const std::string key, std::string &value){
}

// delete key from db
static int keyDel(const std::string key){
static int keyDel(const std::string key, const char key_type){
int64_t count = 0;
nemo::Status s = g_pika_server->db()->Del(key, &count);
nemo::Status s = g_pika_server->db()->DelSingleType(key, &count, key_type);
if (!s.ok()) {
if (s.IsNotFound()) {
LOG(WARNING) << "Del key: "<< key <<" not found ";
Expand Down Expand Up @@ -238,7 +238,7 @@ static int migrateKv(const std::string dest_ip, const int64_t dest_port, const s
}

delete cli;
keyDel(key); //key already been migrated successfully, del error doesn't matter
keyDel(key, 'k'); //key already been migrated successfully, del error doesn't matter
return 1;
}

Expand Down Expand Up @@ -294,7 +294,7 @@ static int migrateHash(const std::string dest_ip, const int64_t dest_port, const
}

delete cli;
keyDel(key); //key already been migrated successfully, del error doesn't matter
keyDel(key, 'h'); //key already been migrated successfully, del error doesn't matter
return 1;
}

Expand Down Expand Up @@ -349,7 +349,7 @@ static int migrateList(const std::string dest_ip, const int64_t dest_port, const
}

delete cli;
keyDel(key); //key already been migrated successfully, del error doesn't matter
keyDel(key, 'l'); //key already been migrated successfully, del error doesn't matter
return 1;
}

Expand Down Expand Up @@ -404,7 +404,7 @@ static int migrateSet(const std::string dest_ip, const int64_t dest_port, const
}

delete cli;
keyDel(key); //key already been migrated successfully, del error doesn't matter
keyDel(key, 's'); //key already been migrated successfully, del error doesn't matter
return 1;
}

Expand Down Expand Up @@ -460,7 +460,7 @@ static int migrateZset(const std::string dest_ip, const int64_t dest_port, const
}

delete cli;
keyDel(key);
keyDel(key, 'z');
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion third/nemo
Submodule nemo updated 2 files
+1 −0 include/nemo.h
+71 −0 src/nemo_kv.cc

0 comments on commit 6527105

Please sign in to comment.