Accepting request 597904 from network:ha-clustering:Unstable

update to 9.3.0

OBS-URL: https://build.opensuse.org/request/show/597904
OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd-utils?expand=0&rev=58
This commit is contained in:
nick wang 2018-04-19 00:42:25 +00:00 committed by Git OBS Bridge
parent b43d0fa3f3
commit 45d23e5e45
8 changed files with 24 additions and 221 deletions

View File

@ -1,108 +0,0 @@
From b5eab810ded459792c24a4bc5db5ce272ea1ee15 Mon Sep 17 00:00:00 2001
From: Philipp Reisner <philipp.reisner@linbit.com>
Date: Fri, 26 Jan 2018 16:09:01 +0100
Subject: [PATCH] v9,drbdadm,stacking: Fix setting the disk in stacked host
sections
This got broken on the long way from drbd-8.4 to 9.
---
diff --git a/user/v9/drbdadm_postparse.c b/user/v9/drbdadm_postparse.c
index 1cefd5c2..b9e90de8 100644
--- a/user/v9/drbdadm_postparse.c
+++ b/user/v9/drbdadm_postparse.c
@@ -493,9 +493,9 @@ void set_peer_in_resource(struct d_resource* res, int peer_required)
add_no_bitmap_opt(res);
}
-void set_disk_in_res(struct d_resource *res)
+void set_stacked_disk_in_res(struct d_resource *res)
{
- struct d_host_info *host;
+ struct d_host_info *host, *lower_host;
struct d_volume *a, *b;
if (res->ignore)
@@ -505,41 +505,39 @@ void set_disk_in_res(struct d_resource *res)
if (!host->lower)
continue;
- if (host->lower->ignore)
- continue;
-
- check_volume_sets_equal(res, host, host->lower->me);
- if (!config_valid)
- /* don't even bother for broken config. */
- continue;
+ for_each_host(lower_host, &host->lower->all_hosts) {
+ check_volume_sets_equal(res, host, lower_host);
+ if (!config_valid)
+ /* don't even bother for broken config. */
+ continue;
- /* volume lists are sorted on vnr */
- a = STAILQ_FIRST(&host->volumes);
- b = STAILQ_FIRST(&host->lower->me->volumes);
- while (a) {
- while (b && a->vnr > b->vnr) {
- /* Lower resource has more volumes.
- * Probably unusual, but we decided
- * that it should be legal.
- * Skip those that do not match */
- b = STAILQ_NEXT(b, link);
- }
- if (a && b && a->vnr == b->vnr) {
- if (b->device)
- m_asprintf(&a->disk, "%s", b->device);
- else
- m_asprintf(&a->disk, "/dev/drbd%u", b->device_minor);
- /* stacked implicit volumes need internal meta data, too */
- if (!a->meta_disk)
- m_asprintf(&a->meta_disk, "internal");
- if (!a->meta_index)
- m_asprintf(&a->meta_index, "internal");
- a = STAILQ_NEXT(a, link);
- b = STAILQ_NEXT(b, link);
- } else {
- /* config_invalid should have been set
- * by check_volume_sets_equal */
- assert(0);
+ a = STAILQ_FIRST(&host->volumes);
+ b = STAILQ_FIRST(&lower_host->volumes);
+ while (a) {
+ while (b && a->vnr > b->vnr) {
+ /* Lower resource has more volumes.
+ * Probably unusual, but we decided
+ * that it should be legal.
+ * Skip those that do not match */
+ b = STAILQ_NEXT(b, link);
+ }
+ if (a && b && a->vnr == b->vnr) {
+ if (b->device)
+ m_asprintf(&a->disk, "%s", b->device);
+ else
+ m_asprintf(&a->disk, "/dev/drbd%u", b->device_minor);
+ /* stacked implicit volumes need internal meta data, too */
+ if (!a->meta_disk)
+ m_asprintf(&a->meta_disk, "internal");
+ if (!a->meta_index)
+ m_asprintf(&a->meta_index, "internal");
+ a = STAILQ_NEXT(a, link);
+ b = STAILQ_NEXT(b, link);
+ } else {
+ /* config_invalid should have been set
+ * by check_volume_sets_equal */
+ assert(0);
+ }
}
}
}
@@ -1140,7 +1138,7 @@ void post_parse(struct resources *resources, enum pp_flags flags)
// Needs "me" set already
for_each_resource(res, resources)
if (res->stacked_on_one)
- set_disk_in_res(res);
+ set_stacked_disk_in_res(res);
for_each_resource(res, resources)
fixup_peer_devices(res);

View File

@ -1,48 +0,0 @@
drbdadm : Support pass force option to dump md
At least till v8.9.6, drbdadm dump-md support
"--force" option to dump the metadata (might
stale) while the device still running.
drbdmeta still able to dump but drbdadm
will show "unrecognized option"
diff -Naur drbd-utils-9.0.0.orig/user/v9/config_flags.c drbd-utils-9.0.0/user/v9/config_flags.c
--- drbd-utils-9.0.0.orig/user/v9/config_flags.c 2018-01-25 10:49:04.419550855 +0800
+++ drbd-utils-9.0.0/user/v9/config_flags.c 2018-01-25 10:51:53.412986007 +0800
@@ -1081,6 +1081,12 @@
{ } },
};
+struct context_def dump_md_ctx = {
+ .fields = {
+ { .name = "force", .argument_is_optional = true },
+ { } },
+};
+
struct context_def adjust_ctx = {
.fields = {
{ "skip-disk", .argument_is_optional = true },
diff -Naur drbd-utils-9.0.0.orig/user/v9/config_flags.h drbd-utils-9.0.0/user/v9/config_flags.h
--- drbd-utils-9.0.0.orig/user/v9/config_flags.h 2018-01-25 10:49:04.419550855 +0800
+++ drbd-utils-9.0.0/user/v9/config_flags.h 2018-01-25 10:51:37.420850181 +0800
@@ -100,6 +100,7 @@
extern struct context_def device_options_ctx;
extern struct context_def invalidate_ctx;
extern struct context_def create_md_ctx;
+extern struct context_def dump_md_ctx;
extern struct context_def adjust_ctx;
extern struct context_def peer_device_options_ctx;
extern struct context_def handlers_ctx;
diff -Naur drbd-utils-9.0.0.orig/user/v9/drbdadm_main.c drbd-utils-9.0.0/user/v9/drbdadm_main.c
--- drbd-utils-9.0.0.orig/user/v9/drbdadm_main.c 2018-01-25 10:49:04.419550855 +0800
+++ drbd-utils-9.0.0/user/v9/drbdadm_main.c 2018-01-25 10:49:44.659892592 +0800
@@ -357,7 +357,7 @@
static struct adm_cmd create_md_cmd = {"create-md", adm_create_md, &create_md_ctx, ACF1_MINOR_ONLY };
static struct adm_cmd show_gi_cmd = {"show-gi", adm_setup_and_meta, ACF1_PEER_DEVICE .disk_required = 1};
static struct adm_cmd get_gi_cmd = {"get-gi", adm_setup_and_meta, ACF1_PEER_DEVICE .disk_required = 1};
-static struct adm_cmd dump_md_cmd = {"dump-md", adm_drbdmeta, ACF1_MINOR_ONLY };
+static struct adm_cmd dump_md_cmd = {"dump-md", adm_drbdmeta, &dump_md_ctx, ACF1_MINOR_ONLY };
static struct adm_cmd wipe_md_cmd = {"wipe-md", adm_drbdmeta, ACF1_MINOR_ONLY };
static struct adm_cmd apply_al_cmd = {"apply-al", adm_drbdmeta, ACF1_MINOR_ONLY };
static struct adm_cmd forget_peer_cmd = {"forget-peer", adm_forget_peer, ACF1_DISCONNECT };

View File

@ -5,10 +5,10 @@
<param name="filename">drbd-utils</param>
<!--
build service using release drbd-utils atm.
<param name="version">9.2.0</param>
<param name="version">9.3.0</param>
Using release tarball instead of git since need buildtag.c/h
-->
<param name="versionformat">9.2.0+git.%h</param>
<param name="versionformat">9.3.0+git.%h</param>
<param name="revision">master</param>
</service>

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:11299b555b703440ef0af2c74b69cf6dfb833e050b87cfdc3b93d0b71d8820a6
size 958084

3
drbd-utils-9.3.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:67aec182009ab4a48cce10a58ecaf84a38886dc88433f9ae04ee2ab3b0360ca2
size 1052056

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Sun Apr 8 02:43:23 UTC 2018 - nwang@suse.com
- Update to 9.3.0
* update to Japanese man pages
* fixes for stacking in drbd-9.0
* fixes for proxy support in drbd-9.0
* fix adjusting --bitmap=no peer to diskfull
* VCS: typos and fixes for stacked resources
- Remove upstream patch Fix-no-bitmap-allocate-for-stacked-res.patch
- Remove upstream patch Support-pass-force-to-dump-md.patch
- Remove patch fix-segfault-up-stacked-resource.patch with
upstream fix 74b1cbb274
-------------------------------------------------------------------
Mon Feb 5 07:09:33 UTC 2018 - nwang@suse.com

View File

@ -19,7 +19,7 @@
%bcond_without drbdmon
Name: drbd-utils
Version: 9.2.0
Version: 9.3.0
Release: 0
Summary: Distributed Replicated Block Device
License: GPL-2.0+
@ -31,14 +31,11 @@ Source: http://www.drbd.org/download/drbd/utils/%{name}-%{version}.tar.g
Patch1: init-script-fixes.diff
Patch2: fix-libdir-in-Makefile.patch
Patch3: fence-after-pacemaker-down.patch
Patch4: fix-segfault-up-stacked-resource.patch
# PATCH-SUSE-FIX: Disable quorum in default configuration (bsc#1032142)
Patch5: 0001-Disable-quorum-in-default-configuration-bsc-1032142.patch
Patch6: fix_call_khelper_with_stack.patch
Patch7: move_fencing_from_disk_to_net_in_example.patch
Patch8: skip_sh-b-pri_in_v9.patch
Patch9: Fix-no-bitmap-allocate-for-stacked-res.patch
Patch10: Support-pass-force-to-dump-md.patch
Patch4: 0001-Disable-quorum-in-default-configuration-bsc-1032142.patch
Patch5: fix_call_khelper_with_stack.patch
Patch6: move_fencing_from_disk_to_net_in_example.patch
Patch7: skip_sh-b-pri_in_v9.patch
Provides: drbd-bash-completion = %{version}
Provides: drbd-pacemaker = %{version}
@ -88,9 +85,6 @@ raid 1. It is a building block for setting up clusters.
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%build
export WANT_DRBD_REPRODUCIBLE_BUILD=1

View File

@ -1,49 +0,0 @@
diff -Naur drbd-utils-8.9.6.orig/user/v9/drbdadm.h drbd-utils-8.9.6/user/v9/drbdadm.h
--- drbd-utils-8.9.6.orig/user/v9/drbdadm.h 2016-06-23 18:20:40.608796513 +0800
+++ drbd-utils-8.9.6/user/v9/drbdadm.h 2016-06-23 18:21:18.828684887 +0800
@@ -388,6 +388,7 @@
extern void global_validate_maybe_expand_die_if_invalid(int expand, enum pp_flags flags);
extern struct d_option *new_opt(char *name, char *value);
extern int hostname_in_list(const char *name, struct names *names);
+extern bool hostnames_equal(const char *a, const char *b);
extern char *_names_to_str(char* buffer, struct names *names);
extern char *_names_to_str_c(char* buffer, struct names *names, char c);
#define NAMES_STR_SIZE 255
diff -Naur drbd-utils-8.9.6.orig/user/v9/drbdadm_postparse.c drbd-utils-8.9.6/user/v9/drbdadm_postparse.c
--- drbd-utils-8.9.6.orig/user/v9/drbdadm_postparse.c 2016-06-23 18:20:40.608796513 +0800
+++ drbd-utils-8.9.6/user/v9/drbdadm_postparse.c 2016-06-23 18:21:13.644700061 +0800
@@ -98,6 +98,21 @@
}
}
+struct d_host_info *find_host_info_by_fakename(struct d_resource* res, char *name)
+{
+ struct d_host_info *host;
+ char *concat_name;
+
+ for_each_host(host, &res->all_hosts) {
+ concat_name = strdup(names_to_str_c(&host->on_hosts, '_'));
+ if (hostnames_equal(name, concat_name))
+ return host;
+ }
+
+ return NULL;
+}
+
+
struct d_host_info *find_host_info_by_name(struct d_resource* res, char *name)
{
struct d_host_info *host;
@@ -403,7 +418,11 @@
if (conn->peer) {
host_info = conn->peer;
} else {
- host_info = find_host_info_by_name(res, candidate->name);
+ if (candidate->faked_hostname) {
+ host_info = find_host_info_by_fakename(res, candidate->name);
+ } else {
+ host_info = find_host_info_by_name(res, candidate->name);
+ }
conn->peer = host_info;
}
path->peer_address = candidate->address.addr ? &candidate->address : &host_info->address;