Compare commits

..
Author SHA1 Message Date
Vitaliy Filippov 0d6eeec6a4 Fix osd_peering_pg_test 2026-04-14 02:44:59 +03:00
28 changed files with 53 additions and 52 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8...3.30)
project(vitastor) project(vitastor)
set(VITASTOR_VERSION "3.0.11") set(VITASTOR_VERSION "3.0.9")
include(CTest) include(CTest)
+1 -1
View File
@@ -1,4 +1,4 @@
VITASTOR_VERSION ?= v3.0.11 VITASTOR_VERSION ?= v3.0.9
all: build push all: build push
+1 -1
View File
@@ -49,7 +49,7 @@ spec:
capabilities: capabilities:
add: ["SYS_ADMIN"] add: ["SYS_ADMIN"]
allowPrivilegeEscalation: true allowPrivilegeEscalation: true
image: vitalif/vitastor-csi:v3.0.11 image: vitalif/vitastor-csi:v3.0.9
args: args:
- "--node=$(NODE_ID)" - "--node=$(NODE_ID)"
- "--endpoint=$(CSI_ENDPOINT)" - "--endpoint=$(CSI_ENDPOINT)"
+1 -1
View File
@@ -121,7 +121,7 @@ spec:
privileged: true privileged: true
capabilities: capabilities:
add: ["SYS_ADMIN"] add: ["SYS_ADMIN"]
image: vitalif/vitastor-csi:v3.0.11 image: vitalif/vitastor-csi:v3.0.9
args: args:
- "--node=$(NODE_ID)" - "--node=$(NODE_ID)"
- "--endpoint=$(CSI_ENDPOINT)" - "--endpoint=$(CSI_ENDPOINT)"
+1 -1
View File
@@ -5,7 +5,7 @@ package vitastor
const ( const (
vitastorCSIDriverName = "csi.vitastor.io" vitastorCSIDriverName = "csi.vitastor.io"
vitastorCSIDriverVersion = "3.0.11" vitastorCSIDriverVersion = "3.0.9"
) )
// Config struct fills the parameters of request or user input // Config struct fills the parameters of request or user input
+1 -1
View File
@@ -1,4 +1,4 @@
vitastor (3.0.11-1) unstable; urgency=medium vitastor (3.0.9-1) unstable; urgency=medium
* Bugfixes * Bugfixes
+1 -1
View File
@@ -1,4 +1,4 @@
VITASTOR_VERSION ?= v3.0.11 VITASTOR_VERSION ?= v3.0.9
all: build push all: build push
+1 -1
View File
@@ -4,7 +4,7 @@
# #
# Desired Vitastor version # Desired Vitastor version
VITASTOR_VERSION=v3.0.11 VITASTOR_VERSION=v3.0.9
# Additional arguments for all containers # Additional arguments for all containers
# For example, you may want to specify a custom logging driver here # For example, you may want to specify a custom logging driver here
+2 -2
View File
@@ -26,9 +26,9 @@ at Vitastor Kubernetes operator: https://github.com/Antilles7227/vitastor-operat
The instruction is very simple. The instruction is very simple.
1. Download a Docker image of the desired version: \ 1. Download a Docker image of the desired version: \
`docker pull vitalif/vitastor:v3.0.11` `docker pull vitalif/vitastor:v3.0.9`
2. Install scripts to the host system: \ 2. Install scripts to the host system: \
`docker run --rm -it -v /etc:/host-etc -v /usr/bin:/host-bin vitalif/vitastor:v3.0.11 install.sh` `docker run --rm -it -v /etc:/host-etc -v /usr/bin:/host-bin vitalif/vitastor:v3.0.9 install.sh`
3. Reload udev rules: \ 3. Reload udev rules: \
`udevadm control --reload-rules` `udevadm control --reload-rules`
4. Enable the vitastor-host service: \ 4. Enable the vitastor-host service: \
+2 -2
View File
@@ -25,9 +25,9 @@ Vitastor можно установить в Docker/Podman. При этом etcd,
Инструкция по установке максимально простая. Инструкция по установке максимально простая.
1. Скачайте Docker-образ желаемой версии: \ 1. Скачайте Docker-образ желаемой версии: \
`docker pull vitalif/vitastor:v3.0.11` `docker pull vitalif/vitastor:v3.0.9`
2. Установите скрипты в хост-систему командой: \ 2. Установите скрипты в хост-систему командой: \
`docker run --rm -it -v /etc:/host-etc -v /usr/bin:/host-bin vitalif/vitastor:v3.0.11 install.sh` `docker run --rm -it -v /etc:/host-etc -v /usr/bin:/host-bin vitalif/vitastor:v3.0.9 install.sh`
3. Перезагрузите правила udev: \ 3. Перезагрузите правила udev: \
`udevadm control --reload-rules` `udevadm control --reload-rules`
4. Включите сервис vitastor-host: \ 4. Включите сервис vitastor-host: \
-1
View File
@@ -262,4 +262,3 @@ Options:
| `--logfile <FILE>` | log to the specified file | | `--logfile <FILE>` | log to the specified file |
| `--enforce 1` | enforce permissions at the server side (no by default) | | `--enforce 1` | enforce permissions at the server side (no by default) |
| `--foreground 1` | stay in foreground, do not daemonize | | `--foreground 1` | stay in foreground, do not daemonize |
| `--trace` | trace all NFS requests |
-1
View File
@@ -274,4 +274,3 @@ VitastorFS из GPUDirect.
| `--logfile <FILE>` | записывать логи в заданный файл | | `--logfile <FILE>` | записывать логи в заданный файл |
| `--enforce 1` | проверять права доступа на стороне сервера (по умолчанию нет) | | `--enforce 1` | проверять права доступа на стороне сервера (по умолчанию нет) |
| `--foreground 1` | не уходить в фон после запуска | | `--foreground 1` | не уходить в фон после запуска |
| `--trace` | логгировать все запросы NFS |
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "vitastor-mon", "name": "vitastor-mon",
"version": "3.0.11", "version": "3.0.9",
"description": "Vitastor SDS monitor service", "description": "Vitastor SDS monitor service",
"main": "mon-main.js", "main": "mon-main.js",
"scripts": { "scripts": {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "vitastor", "name": "vitastor",
"version": "3.0.11", "version": "3.0.9",
"description": "Low-level native bindings to Vitastor client library", "description": "Low-level native bindings to Vitastor client library",
"main": "index.js", "main": "index.js",
"keywords": [ "keywords": [
+1 -1
View File
@@ -50,7 +50,7 @@ from cinder.volume import configuration
from cinder.volume import driver from cinder.volume import driver
from cinder.volume import volume_utils from cinder.volume import volume_utils
VITASTOR_VERSION = '3.0.11' VITASTOR_VERSION = '3.0.9'
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
+2 -2
View File
@@ -1,11 +1,11 @@
Name: vitastor Name: vitastor
Version: 3.0.11 Version: 3.0.9
Release: 1%{?dist} Release: 1%{?dist}
Summary: Vitastor, a fast software-defined clustered block storage Summary: Vitastor, a fast software-defined clustered block storage
License: Vitastor Network Public License 1.1 License: Vitastor Network Public License 1.1
URL: https://vitastor.io/ URL: https://vitastor.io/
Source0: vitastor-3.0.11.el10.tar.gz Source0: vitastor-3.0.9.el10.tar.gz
BuildRequires: gperftools-devel BuildRequires: gperftools-devel
BuildRequires: gcc-c++ BuildRequires: gcc-c++
+2 -2
View File
@@ -1,11 +1,11 @@
Name: vitastor Name: vitastor
Version: 3.0.11 Version: 3.0.9
Release: 1%{?dist} Release: 1%{?dist}
Summary: Vitastor, a fast software-defined clustered block storage Summary: Vitastor, a fast software-defined clustered block storage
License: Vitastor Network Public License 1.1 License: Vitastor Network Public License 1.1
URL: https://vitastor.io/ URL: https://vitastor.io/
Source0: vitastor-3.0.11.el7.tar.gz Source0: vitastor-3.0.9.el7.tar.gz
BuildRequires: gperftools-devel BuildRequires: gperftools-devel
BuildRequires: devtoolset-9-gcc-c++ BuildRequires: devtoolset-9-gcc-c++
+2 -2
View File
@@ -1,11 +1,11 @@
Name: vitastor Name: vitastor
Version: 3.0.11 Version: 3.0.9
Release: 1%{?dist} Release: 1%{?dist}
Summary: Vitastor, a fast software-defined clustered block storage Summary: Vitastor, a fast software-defined clustered block storage
License: Vitastor Network Public License 1.1 License: Vitastor Network Public License 1.1
URL: https://vitastor.io/ URL: https://vitastor.io/
Source0: vitastor-3.0.11.el8.tar.gz Source0: vitastor-3.0.9.el8.tar.gz
BuildRequires: gperftools-devel BuildRequires: gperftools-devel
BuildRequires: gcc-toolset-9-gcc-c++ BuildRequires: gcc-toolset-9-gcc-c++
+2 -2
View File
@@ -1,11 +1,11 @@
Name: vitastor Name: vitastor
Version: 3.0.11 Version: 3.0.9
Release: 1%{?dist} Release: 1%{?dist}
Summary: Vitastor, a fast software-defined clustered block storage Summary: Vitastor, a fast software-defined clustered block storage
License: Vitastor Network Public License 1.1 License: Vitastor Network Public License 1.1
URL: https://vitastor.io/ URL: https://vitastor.io/
Source0: vitastor-3.0.11.el9.tar.gz Source0: vitastor-3.0.9.el9.tar.gz
BuildRequires: gperftools-devel BuildRequires: gperftools-devel
BuildRequires: gcc-c++ BuildRequires: gcc-c++
+1 -1
View File
@@ -20,7 +20,7 @@ if("${CMAKE_INSTALL_PREFIX}" MATCHES "^/usr/local/?$")
endif() endif()
set(ENABLE_COVERAGE false CACHE BOOL "Enable code coverage") set(ENABLE_COVERAGE false CACHE BOOL "Enable code coverage")
add_definitions(-DVITASTOR_VERSION="3.0.11") add_definitions(-DVITASTOR_VERSION="3.0.9")
add_definitions(-D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wno-sign-compare -Wno-comment -Wno-parentheses -Wno-pointer-arith -fdiagnostics-color=always -fno-omit-frame-pointer -fvisibility=hidden -I ${CMAKE_SOURCE_DIR}/src) add_definitions(-D_GNU_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wno-sign-compare -Wno-comment -Wno-parentheses -Wno-pointer-arith -fdiagnostics-color=always -fno-omit-frame-pointer -fvisibility=hidden -I ${CMAKE_SOURCE_DIR}/src)
add_link_options(-fno-omit-frame-pointer) add_link_options(-fno-omit-frame-pointer)
if (${WITH_ASAN}) if (${WITH_ASAN})
+7 -7
View File
@@ -1119,13 +1119,6 @@ resume_2:
// Finished successfully // Finished successfully
// Even if the PG count has changed in meanwhile we treat it as success // Even if the PG count has changed in meanwhile we treat it as success
// because if some operations were invalid for the new PG count we'd get errors // because if some operations were invalid for the new PG count we'd get errors
if (op->opcode == OSD_OP_READ || op->opcode == OSD_OP_READ_BITMAP || op->opcode == OSD_OP_READ_CHAIN_BITMAP)
{
// Copy part bitmaps only after finishing all part reads
for (auto & part: op->parts)
if ((part.flags & (PART_SENT|PART_DONE|PART_VALID)) == (PART_SENT|PART_DONE|PART_VALID))
copy_part_bitmap(op, &part);
}
if (op->opcode == OSD_OP_READ || op->opcode == OSD_OP_READ_CHAIN_BITMAP) if (op->opcode == OSD_OP_READ || op->opcode == OSD_OP_READ_CHAIN_BITMAP)
{ {
// Check parent inode // Check parent inode
@@ -1637,6 +1630,13 @@ void cluster_client_t::handle_op_part(cluster_op_part_t *part)
} }
if (op->inflight_count == 0 && !op->retry_after) if (op->inflight_count == 0 && !op->retry_after)
{ {
// Copy part bitmaps only after finishing all part reads
if (op->opcode == OSD_OP_READ || op->opcode == OSD_OP_READ_BITMAP || op->opcode == OSD_OP_READ_CHAIN_BITMAP)
{
for (auto & part: op->parts)
if ((part.flags & (PART_SENT|PART_VALID|PART_DONE)) == (PART_SENT|PART_VALID|PART_DONE))
copy_part_bitmap(op, &part);
}
if (op->opcode == OSD_OP_SYNC) if (op->opcode == OSD_OP_SYNC)
continue_sync(op); continue_sync(op);
else else
+4 -1
View File
@@ -8,7 +8,6 @@
osd_op_t::~osd_op_t() osd_op_t::~osd_op_t()
{ {
assert(!bs_op); assert(!bs_op);
assert(!op_data);
if (bitmap_buf) if (bitmap_buf)
{ {
free(bitmap_buf); free(bitmap_buf);
@@ -23,6 +22,10 @@ osd_op_t::~osd_op_t()
// So we don't reuse it, but free it every time // So we don't reuse it, but free it every time
free(buf); free(buf);
} }
if (op_data)
{
free(op_data);
}
} }
bool osd_op_t::is_recovery_related() bool osd_op_t::is_recovery_related()
+1 -1
View File
@@ -6,7 +6,7 @@ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: Vitastor Name: Vitastor
Description: Vitastor client library Description: Vitastor client library
Version: 3.0.11 Version: 3.0.9
Libs: -L${libdir} -lvitastor_client Libs: -L${libdir} -lvitastor_client
Cflags: -I${includedir} Cflags: -I${includedir}
-2
View File
@@ -286,8 +286,6 @@ struct rm_inode_t
.data = data, .data = data,
}; };
} }
// Wakeup callers (otherwise they wake up only on next loop())
parent->ringloop->wakeup();
} }
in_continue = false; in_continue = false;
} }
+1 -2
View File
@@ -121,7 +121,6 @@ static const char* help_text =
" --logfile <FILE> log to the specified file\n" " --logfile <FILE> log to the specified file\n"
" --enforce 1 enforce permissions at the server side (default is disabled)\n" " --enforce 1 enforce permissions at the server side (default is disabled)\n"
" --foreground 1 stay in foreground, do not daemonize\n" " --foreground 1 stay in foreground, do not daemonize\n"
" --trace trace all NFS requests\n"
"\n" "\n"
"NFS proxy is stateless if you use immediate_commit=all in your cluster and if\n" "NFS proxy is stateless if you use immediate_commit=all in your cluster and if\n"
"you do not use client_enable_writeback=true, so you can freely use multiple\n" "you do not use client_enable_writeback=true, so you can freely use multiple\n"
@@ -159,7 +158,7 @@ json11::Json::object nfs_proxy_t::parse_args(int narg, const char *args[])
{ {
const char *opt = args[i]+2; const char *opt = args[i]+2;
cfg[str_replace(opt, "-", "_")] = !strcmp(opt, "json") || !strcmp(opt, "block") || cfg[str_replace(opt, "-", "_")] = !strcmp(opt, "json") || !strcmp(opt, "block") ||
!strcmp(opt, "dry-run") || !strcmp(opt, "recalc-stats") || !strcmp(opt, "trace") || !strcmp(opt, "dry-run") || !strcmp(opt, "recalc-stats") ||
!strcmp(opt, "include-empty") || !strcmp(opt, "no-rm") || i == narg-1 ? "1" : args[++i]; !strcmp(opt, "include-empty") || !strcmp(opt, "no-rm") || i == narg-1 ? "1" : args[++i];
} }
else else
+15 -3
View File
@@ -1,8 +1,6 @@
// Copyright (c) Vitaliy Filippov, 2019+ // Copyright (c) Vitaliy Filippov, 2019+
// License: VNPL-1.1 (see README.md for details) // License: VNPL-1.1 (see README.md for details)
#define _LARGEFILE64_SOURCE
#include "malloc_or_die.h" #include "malloc_or_die.h"
#include "osd_peering_pg.h" #include "osd_peering_pg.h"
#define STRIPE_SHIFT 12 #define STRIPE_SHIFT 12
@@ -22,13 +20,20 @@
*/ */
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
pg_t pg = { pg_t pg = {
.state = PG_PEERING, .state = PG_PEERING,
.scheme = POOL_SCHEME_EC,
.pg_size = 3,
.pg_minsize = 2,
.pg_data_size = 2,
.pg_num = 1, .pg_num = 1,
.target_set = { 1, 2, 3 }, .target_set = { 1, 2, 3 },
.cur_set = { 1, 2, 3 }, .cur_set = { 1, 2, 3 },
.peering_state = new pg_peering_state_t(), .peering_state = new pg_peering_state_t(),
}; };
printf("generating\n");
for (uint64_t osd_num = 1; osd_num <= 3; osd_num++) for (uint64_t osd_num = 1; osd_num <= 3; osd_num++)
{ {
pg_list_result_t r = { pg_list_result_t r = {
@@ -48,8 +53,15 @@ int main(int argc, char *argv[])
} }
pg.peering_state->list_results[osd_num] = r; pg.peering_state->list_results[osd_num] = r;
} }
printf("calculating states\n");
timespec tv0;
clock_gettime(CLOCK_REALTIME, &tv0);
pg.calc_object_states(0); pg.calc_object_states(0);
printf("deviation variants=%jd clean=%ju\n", pg.state_dict.size(), pg.clean_count); timespec tv1;
clock_gettime(CLOCK_REALTIME, &tv1);
printf("%.2f deviation variants=%jd clean=%ju\n",
(tv1.tv_sec - tv0.tv_sec + tv1.tv_nsec/1000000000.0 - tv0.tv_nsec/1000000000.0),
pg.state_dict.size(), pg.clean_count);
for (auto it: pg.state_dict) for (auto it: pg.state_dict)
{ {
printf("dev: state=%jx\n", it.second.state); printf("dev: state=%jx\n", it.second.state);
+1 -8
View File
@@ -82,7 +82,6 @@ int osd_t::read_bitmaps(osd_op_t *cur_op, pg_t *pg, int base_state)
goto resume_0; goto resume_0;
else if (op_data->st == base_state+1) else if (op_data->st == base_state+1)
goto resume_1; goto resume_1;
assert(op_data->st < base_state);
if (!pg || pg->state == PG_ACTIVE && pg->scheme == POOL_SCHEME_REPLICATED) if (!pg || pg->state == PG_ACTIVE && pg->scheme == POOL_SCHEME_REPLICATED)
{ {
// Happy path for clean replicated PGs (all bitmaps are available locally) // Happy path for clean replicated PGs (all bitmaps are available locally)
@@ -113,12 +112,6 @@ resume_0:
return 1; return 1;
} }
resume_1: resume_1:
if (op_data->errors > 0)
{
// Failure
finish_op(cur_op, op_data->errcode);
return -1;
}
if (pg->scheme != POOL_SCHEME_REPLICATED) if (pg->scheme != POOL_SCHEME_REPLICATED)
{ {
for (int chain_num = 0; chain_num < op_data->chain_size; chain_num++) for (int chain_num = 0; chain_num < op_data->chain_size; chain_num++)
@@ -614,7 +607,7 @@ void osd_t::send_chained_read_results(pg_t *pg, osd_op_t *cur_op)
{ {
if (cur > prev) if (cur > prev)
{ {
// Send buffer in parts to avoid copying // Send buffer in parts to avoid copying
if (!prev_set) if (!prev_set)
{ {
while ((cur-prev) > zero_buffer_size/bs_bitmap_granularity) while ((cur-prev) > zero_buffer_size/bs_bitmap_granularity)
-2
View File
@@ -83,8 +83,6 @@ void osd_t::finish_op(osd_op_t *cur_op, int retval)
rm_inflight(pg); rm_inflight(pg);
} }
assert(!cur_op->op_data->subops); assert(!cur_op->op_data->subops);
free(cur_op->op_data);
cur_op->op_data = NULL;
} }
cur_op->reply.hdr.magic = SECONDARY_OSD_REPLY_MAGIC; cur_op->reply.hdr.magic = SECONDARY_OSD_REPLY_MAGIC;
cur_op->reply.hdr.id = cur_op->req.hdr.id; cur_op->reply.hdr.id = cur_op->req.hdr.id;