Skip to content

Commit db8848f

Browse files
authored
Merge branch 'OpenAtomFoundation:unstable' into 240624_use_fwrite_binlog
2 parents 8efcbf0 + 1de6598 commit db8848f

15 files changed

Lines changed: 65 additions & 213 deletions

File tree

.github/workflows/pika.yml

Lines changed: 0 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -78,146 +78,6 @@ jobs:
7878
chmod +x integrate_test.sh
7979
sh integrate_test.sh
8080
81-
build_on_centos:
82-
runs-on: ubuntu-latest
83-
container:
84-
image: centos:7
85-
86-
steps:
87-
- name: set up mirror
88-
run: |
89-
rm -rf /etc/yum.repos.d/CentOS-Base.repo
90-
cat > /etc/yum.repos.d/CentOS-Base.repo << EOL
91-
[base]
92-
name=CentOS-\$releasever - Base
93-
baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/os/\$basearch/
94-
gpgcheck=1
95-
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
96-
97-
[updates]
98-
name=CentOS-\$releasever - Updates
99-
baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/updates/\$basearch/
100-
gpgcheck=1
101-
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
102-
103-
[extras]
104-
name=CentOS-\$releasever - Extras
105-
baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/extras/\$basearch/
106-
gpgcheck=1
107-
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
108-
109-
[centosplus]
110-
name=CentOS-\$releasever - Plus
111-
baseurl=https://mirrors.aliyun.com/centos-vault/7.9.2009/centosplus/\$basearch/
112-
gpgcheck=1
113-
enabled=0
114-
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
115-
EOL
116-
117-
cat > /etc/yum.repos.d/CentOS-SCLo-scl.repo << EOL
118-
[centos-sclo-sclo]
119-
name=CentOS-7 - SCLo sclo
120-
baseurl=https://mirrors.aliyun.com/centos/7/sclo/x86_64/sclo/
121-
gpgcheck=1
122-
enabled=1
123-
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
124-
125-
[centos-sclo-sclo-source]
126-
name=CentOS-7 - SCLo sclo Source
127-
baseurl=https://mirrors.aliyun.com/centos/7/sclo/Source/sclo/
128-
gpgcheck=1
129-
enabled=0
130-
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
131-
EOL
132-
133-
cat > /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo << EOL
134-
[centos-sclo-rh]
135-
name=CentOS-7 - SCLo rh
136-
baseurl=https://mirrors.aliyun.com/centos/7/sclo/x86_64/rh/
137-
gpgcheck=1
138-
enabled=1
139-
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
140-
141-
[centos-sclo-rh-source]
142-
name=CentOS-7 - SCLo rh Source
143-
baseurl=https://mirrors.aliyun.com/centos/7/sclo/Source/rh/
144-
gpgcheck=1
145-
enabled=0
146-
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo
147-
EOL
148-
149-
rpm --import https://www.centos.org/keys/RPM-GPG-KEY-CentOS-7
150-
rpm --import https://www.centos.org/keys/RPM-GPG-KEY-CentOS-SIG-SCLo
151-
152-
yum clean all
153-
yum makecache
154-
155-
- name: Install deps
156-
run: |
157-
yum install -y wget git autoconf centos-release-scl gcc
158-
yum install -y devtoolset-10-gcc devtoolset-10-gcc-c++ devtoolset-10-make devtoolset-10-bin-util
159-
yum install -y llvm-toolset-7 llvm-toolset-7-clang tcl which
160-
161-
- name: Set up Go
162-
uses: actions/setup-go@v3
163-
with:
164-
go-version: 1.19
165-
166-
- name: Install cmake
167-
run: |
168-
wget https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4-linux-x86_64.sh
169-
bash ./cmake-3.26.4-linux-x86_64.sh --skip-license --prefix=/usr
170-
171-
- name: Checkout
172-
uses: actions/checkout@v3
173-
with:
174-
fetch-depth: 0
175-
176-
- name: Configure CMake
177-
run: |
178-
source /opt/rh/devtoolset-10/enable
179-
cmake -B build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DUSE_PIKA_TOOLS=ON -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address
180-
181-
- uses: actions/cache@v3
182-
with:
183-
path: ${{ github.workspace }}/deps
184-
key: ${{ runner.os }}-centos-deps-${{ hashFiles('**/CMakeLists.txt') }}
185-
186-
- uses: actions/cache@v3
187-
with:
188-
path: ${{ github.workspace }}/buildtrees
189-
key: ${{ runner.os }}-centos-buildtrees-${{ hashFiles('**/CMakeLists.txt') }}
190-
191-
- name: Build
192-
run: |
193-
source /opt/rh/devtoolset-10/enable
194-
cmake --build build --config ${{ env.BUILD_TYPE }}
195-
196-
- name: Test
197-
working-directory: ${{ github.workspace }}/build
198-
run: ctest -C ${{ env.BUILD_TYPE }}
199-
200-
- name: Unit Test
201-
working-directory: ${{ github.workspace }}
202-
run: ./pikatests.sh all
203-
204-
- name: Start codis, pika master and pika slave
205-
working-directory: ${{ github.workspace }}/build
206-
run: |
207-
chmod +x ../tests/integration/start_master_and_slave.sh
208-
../tests/integration/start_master_and_slave.sh
209-
chmod +x ../tests/integration/start_codis.sh
210-
../tests/integration/start_codis.sh
211-
212-
- name: Run Go E2E Tests
213-
working-directory: ${{ github.workspace }}/build
214-
run: |
215-
cd ../tools/pika_keys_analysis/
216-
go test -v ./...
217-
cd ../../tests/integration/
218-
chmod +x integrate_test.sh
219-
sh integrate_test.sh
220-
22181
build_on_macos:
22282
runs-on: macos-12
22383

.github/workflows/release.yml

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -47,53 +47,9 @@ jobs:
4747
name: ${{ matrix.name }}.sha256sum
4848
path: build/${{ matrix.name }}.sha256sum
4949

50-
centos:
51-
runs-on: ubuntu-latest
52-
container:
53-
image: centos:7
54-
env:
55-
name: ${{ github.event.repository.name }}-${{ github.ref_name }}-centos-amd64.tar.gz
56-
steps:
57-
- name: Install deps
58-
run: |
59-
yum install -y wget git autoconf centos-release-scl gcc perl-Digest-SHA
60-
yum install -y devtoolset-10-gcc devtoolset-10-gcc-c++ devtoolset-10-make devtoolset-10-bin-util
61-
yum install -y llvm-toolset-7 llvm-toolset-7-clang tcl which
62-
63-
- name: Install cmake
64-
run: |
65-
wget https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4-linux-x86_64.sh
66-
bash ./cmake-3.26.4-linux-x86_64.sh --skip-license --prefix=/usr
67-
68-
- name: Checkout sources
69-
uses: actions/checkout@v3
70-
with:
71-
fetch-depth: 0
72-
73-
- name: Release build os - centos
74-
run: |
75-
chmod +x ci/release-build.sh
76-
./ci/release-build.sh install centos ${{ env.BUILD_TYPE }} -xe
77-
78-
- name: Calculate checksum and rename binary
79-
shell: bash
80-
run: ./ci/release-build.sh checksum ${{ github.event.repository.name }} ${{ env.name }}
81-
82-
- name: Upload artifacts
83-
uses: actions/upload-artifact@v3
84-
with:
85-
name: ${{ env.name }}
86-
path: build/${{ env.name }}
87-
88-
- name: Upload checksum of artifacts
89-
uses: actions/upload-artifact@v3
90-
with:
91-
name: ${{ env.name }}.sha256sum
92-
path: build/${{ env.name }}.sha256sum
93-
9450
release:
9551
name: Release artifacts
96-
needs: [ build,centos ]
52+
needs: [ build ]
9753
runs-on: ubuntu-latest
9854
steps:
9955
- name: Download artifacts

CHANGELOG.MD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444

4545
## Bugfix
4646

47+
- Solve the issue where failing to destruct 'iter' causes 'pkpatternmatchdel' not to delete 'iter' before returning, potentially leading to RocksDB perpetually referencing a version, causing data inconsistency.[#2785](https://github.com/OpenAtomFoundation/pika/pull/2785)@[wangshao1](https://github.com/wangshao1)
48+
4749
- Fixed an issue with parsing the config parameter min-blob-size when it includes units.[#2767](https://github.com/OpenAtomFoundation/pika/pull/2767)@[wangshao1](https://github.com/wangshao1)
4850

4951
- Fixed an issue with abnormal return values in ZREVRANK.[#2763](https://github.com/OpenAtomFoundation/pika/pull/2763)@[chejinge](https://github.com/chejinge)

CHANGELOG_CN.MD

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444

4545
## Bugfix
4646

47+
- 修复 iter 未被析构,导致 pkpatternmatchdel 在返回之前不会删除 iter,这可能会导致 rocksdb 永远引用一个版本,导致数据不符合预期的问题[#2785](https://github.com/OpenAtomFoundation/pika/pull/2785)@[wangshao1](https://github.com/wangshao1)
48+
4749
- 修复 config 参数 min-blob-size 带单位时解析错误的问题[#2767](https://github.com/OpenAtomFoundation/pika/pull/2767)@[wangshao1](https://github.com/wangshao1)
4850

4951
- 修复 zverank 返回值异常的问题[#2763](https://github.com/OpenAtomFoundation/pika/pull/2763)@[chejinge](https://github.com/chejinge)
@@ -88,7 +90,7 @@
8890

8991
- 发版支持自动打包 centos7 和 centos8 平台的二进制编译包[#2535](https://github.com/OpenAtomFoundation/pika/pull/2535)@[baerwang](https://github.com/baerwang)
9092

91-
- 修复Codis 侧的 getrange 命令没有返回预期结果的问题[#2510](https://github.com/OpenAtomFoundation/pika/pull/2510)@[luky116](https://github.com/luky116)
93+
- 修复 Codis 侧的 getrange 命令没有返回预期结果的问题[#2510](https://github.com/OpenAtomFoundation/pika/pull/2510)@[luky116](https://github.com/luky116)
9294

9395

9496
# v3.5.4

ci/release-build.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ function configure_cmake() {
2222
cmake -B build -DCMAKE_C_COMPILER=/usr/local/opt/gcc@10/bin/gcc-10 -DUSE_PIKA_TOOLS=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE
2323
elif [[ $OS == *"ubuntu"* ]]; then
2424
cmake -B build -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DUSE_PIKA_TOOLS=ON -DCMAKE_CXX_FLAGS="-s" -DCMAKE_EXE_LINKER_FLAGS="-s"
25-
elif [[ $OS == *"centos"* ]]; then
26-
source /opt/rh/devtoolset-10/enable
27-
cmake -B build -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DUSE_PIKA_TOOLS=ON -DCMAKE_CXX_FLAGS_DEBUG=-fsanitize=address
2825
fi
2926
echo "configure cmake after ..."
3027
}

codis/pkg/topom/topom_group.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ func (s *Topom) tryFixReplicationRelationship(group *models.Group, groupServer *
391391
return nil
392392
}
393393

394-
// current server is slave, execute the command `slaveof [new master ip] [new master port]`
395-
if err = updateMasterToNewOne(groupServer.Addr, curMasterAddr, s.config.ProductAuth); err != nil {
394+
// current server is slave, execute the command `slaveof [new master ip] [new master port] force`
395+
if err = updateMasterToNewOneForcefully(groupServer.Addr, curMasterAddr, s.config.ProductAuth); err != nil {
396396
return err
397397
}
398398
}

include/pika_rm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class SyncSlaveDB : public SyncDB {
116116
void SetLocalIp(const std::string& local_ip);
117117
void StopRsync();
118118
pstd::Status ActivateRsync();
119-
bool IsRsyncRunning() { return rsync_cli_->IsRunning(); }
119+
bool IsRsyncExited() { return rsync_cli_->IsExitedFromRunning(); }
120120

121121
private:
122122
std::unique_ptr<rsync::RsyncClient> rsync_cli_;

include/rsync_client.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ class RsyncClient : public net::Thread {
6262
bool IsRunning() {
6363
return state_.load() == RUNNING;
6464
}
65+
bool IsExitedFromRunning() {
66+
return state_.load() == STOP && all_worker_exited_.load();
67+
}
6568
bool IsStop() {
6669
return state_.load() == STOP;
6770
}
@@ -92,6 +95,8 @@ class RsyncClient : public net::Thread {
9295
std::atomic<int> finished_work_cnt_ = 0;
9396

9497
std::atomic<State> state_;
98+
std::atomic<bool> error_stopped_{false};
99+
std::atomic<bool> all_worker_exited_{true};
95100
int max_retries_ = 10;
96101
std::unique_ptr<WaitObjectManager> wo_mgr_;
97102
std::condition_variable cond_;

src/net/src/dispatch_thread.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ int DispatchThread::StartThread() {
6464
}
6565

6666
// Adding timer tasks and run timertaskThread
67-
timerTaskThread_.AddTimerTask("blrpop_blocking_info_scan", 250, true,
67+
timer_task_thread_.AddTimerTask("blrpop_blocking_info_scan", 250, true,
6868
[this] { this->ScanExpiredBlockedConnsOfBlrpop(); });
69-
timerTaskThread_.set_thread_name("TimerTaskThread");
70-
timerTaskThread_.StartThread();
69+
timer_task_thread_.set_thread_name("TimerTaskThread");
70+
timer_task_thread_.StartThread();
7171
return ServerThread::StartThread();
7272
}
7373

@@ -88,7 +88,7 @@ int DispatchThread::StopThread() {
8888
worker_thread_[i]->private_data_ = nullptr;
8989
}
9090
}
91-
timerTaskThread_.StopThread();
91+
timer_task_thread_.StopThread();
9292
return ServerThread::StopThread();
9393
}
9494

src/net/src/dispatch_thread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class DispatchThread : public ServerThread {
161161
*/
162162
std::shared_mutex block_mtx_;
163163

164-
TimerTaskThread timerTaskThread_;
164+
TimerTaskThread timer_task_thread_;
165165
}; // class DispatchThread
166166

167167
} // namespace net

0 commit comments

Comments
 (0)