Skip to content

Commit

Permalink
supply datastore integration test
Browse files Browse the repository at this point in the history
Change-Id: Ic3ad15a9444dca34efad5a41c1731d850de5ce11
  • Loading branch information
yangyaokai committed May 31, 2019
1 parent a592320 commit 90302ed
Show file tree
Hide file tree
Showing 48 changed files with 4,844 additions and 529 deletions.
5 changes: 5 additions & 0 deletions conf/chunkserver.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ curve.root_password=
curve.config_path=conf/client.conf
s3.config_path=conf/s3.conf

#
# Local FileSystem settings
#
fs.enable_renameat2=true

#
# Storage engine settings
#
Expand Down
5 changes: 5 additions & 0 deletions deploy/local/chunkserver/conf/chunkserver.conf.0
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ curve.root_password=
curve.config_path=conf/client.conf
s3.config_path=conf/s3.conf

#
# Local FileSystem settings
#
fs.enable_renameat2=true

#
# Storage engine settings
#
Expand Down
5 changes: 5 additions & 0 deletions deploy/local/chunkserver/conf/chunkserver.conf.1
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ curve.root_password=
curve.config_path=conf/client.conf
s3.config_path=conf/s3.conf

#
# Local FileSystem settings
#
fs.enable_renameat2=true

#
# Storage engine settings
#
Expand Down
5 changes: 5 additions & 0 deletions deploy/local/chunkserver/conf/chunkserver.conf.2
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ curve.root_password=
curve.config_path=conf/client.conf
s3.config_path=conf/s3.conf

#
# Local FileSystem settings
#
fs.enable_renameat2=true

#
# Storage engine settings
#
Expand Down
5 changes: 5 additions & 0 deletions deploy/local/chunkserver/conf/chunkserver.conf.docker1
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ curve.root_password=
curve.config_path=conf/client.conf
s3.config_path=conf/s3.conf

#
# Local FileSystem settings
#
fs.enable_renameat2=true

#
# Storage engine settings
#
Expand Down
5 changes: 5 additions & 0 deletions deploy/local/chunkserver/conf/chunkserver.conf.docker2
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ curve.root_password=
curve.config_path=conf/client.conf
s3.config_path=conf/s3.conf

#
# Local FileSystem settings
#
fs.enable_renameat2=true

#
# Storage engine settings
#
Expand Down
5 changes: 5 additions & 0 deletions deploy/local/chunkserver/conf/chunkserver.conf.docker3
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ curve.root_password=
curve.config_path=conf/client.conf
s3.config_path=conf/s3.conf

#
# Local FileSystem settings
#
fs.enable_renameat2=true

#
# Storage engine settings
#
Expand Down
5 changes: 5 additions & 0 deletions deploy/local/chunkserver/conf/chunkserver.conf.docker4
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ curve.root_password=
curve.config_path=conf/client.conf
s3.config_path=conf/s3.conf

#
# Local FileSystem settings
#
fs.enable_renameat2=true

#
# Storage engine settings
#
Expand Down
5 changes: 5 additions & 0 deletions deploy/local/chunkserver/conf/chunkserver_docker.conf.0
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ curve.root_password=
curve.config_path=conf/client.conf
s3.config_path=conf/s3.conf

#
# Local FileSystem settings
#
fs.enable_renameat2=true

#
# Storage engine settings
#
Expand Down
5 changes: 5 additions & 0 deletions deploy/local/chunkserver/conf/chunkserver_docker.conf.1
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ curve.root_password=
curve.config_path=conf/client.conf
s3.config_path=conf/s3.conf

#
# Local FileSystem settings
#
fs.enable_renameat2=true

#
# Storage engine settings
#
Expand Down
5 changes: 5 additions & 0 deletions deploy/local/chunkserver/conf/chunkserver_docker.conf.2
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ curve.root_password=
curve.config_path=conf/client.conf
s3.config_path=conf/s3.conf

#
# Local FileSystem settings
#
fs.enable_renameat2=true

#
# Storage engine settings
#
Expand Down
4 changes: 1 addition & 3 deletions src/chunkserver/datastore/chunkfile_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int ChunkfilePoolHelper::PersistEnCodeMetaInfo(

root[kCRC] = crc;

int fd = fsptr->Open(persistPath.c_str(), O_RDWR|O_CREAT);
int fd = fsptr->Open(persistPath.c_str(), O_RDWR|O_CREAT|O_SYNC);
if (fd < 0) {
LOG(ERROR) << "meta file open failed, "
<< persistPath.c_str();
Expand All @@ -85,7 +85,6 @@ int ChunkfilePoolHelper::PersistEnCodeMetaInfo(
return -1;
}

fsptr->Fsync(fd);
fsptr->Close(fd);
delete[] writeBuffer;
return 0;
Expand Down Expand Up @@ -381,7 +380,6 @@ int ChunkfilePool::RecycleChunk(const std::string& chunkpath) {
}

void ChunkfilePool::UnInitialize() {
fsptr_ = nullptr;
currentdir_ = "";

std::unique_lock<std::mutex> lk(mtx_);
Expand Down
Loading

0 comments on commit 90302ed

Please sign in to comment.