Accepting request 785806 from network:ha-clustering:Factory

OBS-URL: https://build.opensuse.org/request/show/785806
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/drbd?expand=0&rev=85
This commit is contained in:
Dominique Leuenberger 2020-03-17 12:11:18 +00:00 committed by Git OBS Bridge
commit f105a5ae38
8 changed files with 116 additions and 177 deletions

View File

@ -9,9 +9,9 @@
This will download branch first instead of tag. This will download branch first instead of tag.
<param name="revision">drbd-9.0</param> <param name="revision">drbd-9.0</param>
<param name="version">9.0.20~1</param> <param name="version">9.0.22~1</param>
--> -->
<param name="versionformat">9.0.20~1+git.%h</param> <param name="versionformat">9.0.22~1+git.%h</param>
<param name="revision">drbd-9.0</param> <param name="revision">drbd-9.0</param>
</service> </service>

View File

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

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2882a9f5f0b03e5aeba74abdd6f5abf0430fdc7865220ac5b93c18a2070ca461
size 346017

View File

@ -1,118 +0,0 @@
From 215814e03ee59e8aa1c69084732d7036c06b564f Mon Sep 17 00:00:00 2001
From: Philipp Reisner <philipp.reisner@linbit.com>
Date: Wed, 6 Nov 2019 13:29:24 +0100
Subject: [PATCH] drbd: Update resync target's dagtag after a reconciliation
resync
Updating the resync target's dagtag towards the lost node after a
reconciliation resync is the right way to avoid that the reconciliation
resync is done multiple times.
---
drbd/drbd_int.h | 5 +++++
drbd/drbd_main.c | 1 +
drbd/drbd_receiver.c | 7 +++++++
drbd/drbd_sender.c | 21 ++++++++++++++++++++-
4 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/drbd/drbd_int.h b/drbd/drbd_int.h
index 0b13ecd6..7db21238 100644
--- a/drbd/drbd_int.h
+++ b/drbd/drbd_int.h
@@ -1058,6 +1058,11 @@ struct drbd_connection {
u64 current_dagtag_sector;
} send;
+ struct {
+ u64 dagtag_sector;
+ int lost_node_id;
+ } after_reconciliation;
+
unsigned int peer_node_id;
struct list_head twopc_parent_list;
struct rcu_head rcu;
diff --git a/drbd/drbd_main.c b/drbd/drbd_main.c
index 2d52681e..a7294639 100644
--- a/drbd/drbd_main.c
+++ b/drbd/drbd_main.c
@@ -3488,6 +3488,7 @@ struct drbd_connection *drbd_create_connection(struct drbd_resource *resource,
kref_get(&resource->kref);
kref_debug_get(&resource->kref_debug, 3);
connection->resource = resource;
+ connection->after_reconciliation.lost_node_id = -1;
INIT_LIST_HEAD(&connection->transport.paths);
connection->transport.log_prefix = resource->name;
diff --git a/drbd/drbd_receiver.c b/drbd/drbd_receiver.c
index 82abd9c4..f69fc7b8 100644
--- a/drbd/drbd_receiver.c
+++ b/drbd/drbd_receiver.c
@@ -7486,6 +7486,11 @@ static int receive_peer_dagtag(struct drbd_connection *connection, struct packet
if (new_repl_state != L_ESTABLISHED) {
unsigned long irq_flags;
+ if (new_repl_state == L_WF_BITMAP_T) {
+ connection->after_reconciliation.dagtag_sector = be64_to_cpu(p->dagtag);
+ connection->after_reconciliation.lost_node_id = be32_to_cpu(p->node_id);
+ }
+
drbd_info(connection, "Reconciliation resync because \'%s\' disappeared. (o=%d)\n",
lost_peer->transport.net_conf->name, (int)dagtag_offset);
@@ -7893,6 +7898,8 @@ void conn_disconnect(struct drbd_connection *connection)
drain_resync_activity(connection);
+ connection->after_reconciliation.lost_node_id = -1;
+
/* Wait for current activity to cease. This includes waiting for
* peer_request queued to the submitter workqueue. */
conn_wait_ee_empty(connection, &connection->active_ee);
diff --git a/drbd/drbd_sender.c b/drbd/drbd_sender.c
index f71ce5f6..ea6fa372 100644
--- a/drbd/drbd_sender.c
+++ b/drbd/drbd_sender.c
@@ -1035,6 +1035,23 @@ static void init_resync_stable_bits(struct drbd_peer_device *first_target_pd)
clear_bit(STABLE_RESYNC, &device->flags);
}
+static void after_reconciliation_resync(struct drbd_connection *connection)
+{
+ struct drbd_connection *lost_peer =
+ drbd_get_connection_by_node_id(connection->resource,
+ connection->after_reconciliation.lost_node_id);
+
+ if (lost_peer) {
+ if (lost_peer->cstate[NOW] < C_CONNECTED)
+ lost_peer->last_dagtag_sector =
+ connection->after_reconciliation.dagtag_sector;
+
+ kref_put(&lost_peer->kref, drbd_destroy_connection);
+ }
+
+ connection->after_reconciliation.lost_node_id = -1;
+}
+
int drbd_resync_finished(struct drbd_peer_device *peer_device,
enum drbd_disk_state new_peer_disk_state)
{
@@ -1203,7 +1220,7 @@ int drbd_resync_finished(struct drbd_peer_device *peer_device,
} else if (repl_state[NOW] == L_SYNC_SOURCE || repl_state[NOW] == L_PAUSED_SYNC_S) {
if (new_peer_disk_state != D_MASK)
__change_peer_disk_state(peer_device, new_peer_disk_state);
- if (peer_device->connection->agreed_pro_version < 110) {
+ if (connection->agreed_pro_version < 110) {
drbd_uuid_set_bitmap(peer_device, 0UL);
drbd_print_uuids(peer_device, "updated UUIDs");
}
@@ -1226,6 +1243,8 @@ out_unlock:
resync_again(device, source_m, target_m);
spin_unlock_irq(&device->resource->req_lock);
+ if (connection->after_reconciliation.lost_node_id != -1)
+ after_reconciliation_resync(connection);
out:
/* reset start sector, if we reached end of device */
--
2.16.4

View File

@ -1,3 +1,49 @@
-------------------------------------------------------------------
Tue Mar 10 09:03:04 UTC 2020 - nick wang <nwang@suse.com>
- bsc#1166298, Update to drbd-9.0.22-1
* introduce locking to avoid connection retries when UUIDs or
relevant flags change during the exchange of this data
* improve serialization of events after loosing a primary
* fix a constraint in sanitize state that can caused a promote to be
deliced by some other node
* fix a case of a false positive detection of a split brain condition
* allow a resync target to switch to the resync source with less
bits out of sync
* fix bitmap UUID after resync to use current UUID from self rather
than sync source
* fix pushing bitmap UUID into history when changed
* fix regression introduced with 9.0.20, that can cause a missed
resync after a reconciliation resync
* fix regression introduced with 9.0.20, that can cause a missed
resync after a promote on a diskless node
* fix UUID handling in case a node promotes during (a short)
reconciliation resync
* fix removing of a diskless node when quorum is enabled
-------------------------------------------------------------------
Tue Feb 25 07:03:39 UTC 2020 - nick wang <nwang@suse.com>
- Update to drbd-9.0.21-1, require coccinelle >= 1.0.8
* fix compat for write same on linux 4.9 and the Debian users
* fix kernel compat for linux 4.8 and 4.9; this mainly affected Debian
users; The symptoms where slow resync and resync getting stuck always at
the same point
* enable resync of lost and re-created backing devices (think lost node) when
the backing device was thinly provisioned and its current uuid is pre-set
to a 'day0 UUID' (by LINSTOR); that works by copying a unused bitmap slot
which tracks all changes since day 0
* fix attach when bitmap is on PMEM; before it was set to
'all blocks out-of-sync' upon attach
* avoid doing reconciliation resync multiple times by updating the
resync target's dagtag after if completed successfully
* return disk-state from Outdated to UpToDate when it loses connection
while in WFBitMapT and we have a stable and UpToDate peer
* new option --force-resync flag can be passed to new-current-uuid, that
can be used to trigger initial resync without touching the role
- Remove upstream drbd-update-resync-target-s-dagtag.patch
- Modify patch suse-coccinelle.patch to adopt spaas
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Jan 3 08:52:14 UTC 2020 - nick wang <nwang@suse.com> Fri Jan 3 08:52:14 UTC 2020 - nick wang <nwang@suse.com>

View File

@ -23,7 +23,7 @@
%endif %endif
%endif %endif
Name: drbd Name: drbd
Version: 9.0.20~1+git.7dce3c8b Version: 9.0.22~1+git.fe2b5983
Release: 0 Release: 0
Summary: Linux driver for the "Distributed Replicated Block Device" Summary: Linux driver for the "Distributed Replicated Block Device"
License: GPL-2.0-or-later License: GPL-2.0-or-later
@ -36,12 +36,11 @@ Source3: drbd_git_revision
Patch1: fix-resync-finished-with-syncs-have-bits-set.patch Patch1: fix-resync-finished-with-syncs-have-bits-set.patch
Patch2: rely-on-sb-handlers.patch Patch2: rely-on-sb-handlers.patch
Patch3: drbd-fix-zero-metadata-limit-by-page-size-misaligned.patch Patch3: drbd-fix-zero-metadata-limit-by-page-size-misaligned.patch
Patch4: drbd-update-resync-target-s-dagtag.patch
#In 61ff72f401680(v5.5-rc2), pr_warning is removed #In 61ff72f401680(v5.5-rc2), pr_warning is removed
Patch5: without_pr_warning.patch Patch4: without_pr_warning.patch
Patch6: suse-coccinelle.patch Patch99: suse-coccinelle.patch
#https://github.com/openSUSE/rpmlint-checks/blob/master/KMPPolicyCheck.py #https://github.com/openSUSE/rpmlint-checks/blob/master/KMPPolicyCheck.py
BuildRequires: coccinelle BuildRequires: coccinelle >= 1.0.8
BuildRequires: kernel-source BuildRequires: kernel-source
BuildRequires: kernel-syms BuildRequires: kernel-syms
BuildRequires: libelf-devel BuildRequires: libelf-devel
@ -76,8 +75,7 @@ installed kernel.
%patch2 -p1 %patch2 -p1
%patch3 -p1 %patch3 -p1
%patch4 -p1 %patch4 -p1
%patch5 -p1 %patch99 -p1
%patch6 -p1
mkdir source mkdir source
cp -a drbd/. source/. || : cp -a drbd/. source/. || :
@ -97,8 +95,8 @@ export SPAAS='false'
for flavor in %{flavors_to_build}; do for flavor in %{flavors_to_build}; do
rm -rf $flavor rm -rf $flavor
cp -r source $flavor cp -a -r source $flavor
cp %{_sourcedir}/Module.supported $flavor cp -a %{_sourcedir}/Module.supported $flavor
export DRBDSRC="$PWD/obj/$flavor" export DRBDSRC="$PWD/obj/$flavor"
# bsc#1160194, check the coccicheck work. # bsc#1160194, check the coccicheck work.
#make coccicheck #make coccicheck

View File

@ -1 +1 @@
GIT-hash: 7dce3c8be99f4912f1490f9bb37f5aff6c873335 GIT-hash: fe2b59836bdf1c7c81ccbaad8ef8016d9c3ba582

View File

@ -1,60 +1,73 @@
diff -Naur drbd-9.0.20~1+git.7dce3c8b.orig/drbd/drbd-kernel-compat/gen_compat_patch.sh drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/gen_compat_patch.sh diff -Naur drbd-9.0.21~1+git.449d6bf2.orig/drbd/drbd-kernel-compat/gen_compat_patch.sh drbd-9.0.21~1+git.449d6bf2/drbd/drbd-kernel-compat/gen_compat_patch.sh
--- drbd-9.0.20~1+git.7dce3c8b.orig/drbd/drbd-kernel-compat/gen_compat_patch.sh 2020-01-09 13:38:00.998984586 +0800 --- drbd-9.0.21~1+git.449d6bf2.orig/drbd/drbd-kernel-compat/gen_compat_patch.sh 2019-12-16 14:42:10.832866579 +0800
+++ drbd-9.0.20~1+git.7dce3c8b/drbd/drbd-kernel-compat/gen_compat_patch.sh 2020-01-09 13:38:10.407036976 +0800 +++ drbd-9.0.21~1+git.449d6bf2/drbd/drbd-kernel-compat/gen_compat_patch.sh 2019-12-16 15:11:08.209750606 +0800
@@ -41,6 +41,15 @@ @@ -56,29 +56,49 @@
< drbd-kernel-compat/cocci/debugfs_compat_template.cocci.in \ < drbd-kernel-compat/cocci/debugfs_compat_template.cocci.in \
>> $incdir/.compat.cocci; >> $incdir/.compat.cocci
done; done
+ +
+ echo " APPLIED_COCCI_FILES "; + echo " APPLIED_COCCI_FILES ";
+ cat $incdir/applied_cocci_files.txt; + cat $incdir/applied_cocci_files.txt;
+
+ coccilibpath=$(rpm -ql coccinelle|grep standard.h|xargs dirname); + coccilibpath=$(rpm -ql coccinelle|grep standard.h|xargs dirname);
+ echo " SPATCH_SOURCES: "$*; + echo " SPATCH_SOURCES: "$*;
+ echo " COCCI_LIBPATH: "$coccilibpath; + echo " COCCI_LIBPATH: "$coccilibpath;
+ echo " GENCOCCIRULES .compat.cocci";
+ cat $incdir/.compat.cocci;
+ +
echo " SPATCH $chksum "$K; if [ -e $incdir/.compat.cocci ]; then
# Note: $* (or $@) is NOT make magic variable now, this is a shell script - echo " SPATCH $chksum "$K
# make $@, the target file, was passed as $1, and is now $compat_patch - # Note: $* (or $@) is NOT make magic variable now, this is a shell script
@@ -49,7 +58,8 @@ - # make $@, the target file, was passed as $1, and is now $compat_patch
# argument away this is shell $@ respectively $* now. - # make $^, the source (and header) files spatch should operate on,
# we know we don't have white-space in the argument list - # are "the rest of the shell argument array", so after shifting the first
- # argument away this is shell $@ respectively $* now.
- command="spatch --sp-file $incdir/.compat.cocci $* --macro-file drbd-kernel-compat/cocci_macros.h --very-quiet > $compat_patch.tmp 2> $incdir/.spatch.stderr;" - # we know we don't have white-space in the argument list
+ command="spatch --sp-file $incdir/.compat.cocci $* --macro-file drbd-kernel-compat/cocci_macros.h --macro-file-builtins $coccilibpath/standard.h --iso-file $coccilibpath/standard.iso --very-quiet > $compat_patch.tmp 2> $incdir/.spatch.stderr;" -
+ echo " SPATCH COMMAND $command "; - command="spatch --sp-file $incdir/.compat.cocci $* --macro-file drbd-kernel-compat/cocci_macros.h --very-quiet > $compat_patch.tmp 2> $incdir/.spatch.stderr;"
-
if test -t 0; then - if test -t 0; then
$SHELL -c "$command" - $SHELL -c "$command"
@@ -59,6 +69,14 @@ - else
# They may ignore INT and TERM; if you have to, use HUP. - # spatch is broken in a way: it "requires" a tty.
</dev/null &> /dev/null script --append $incdir/.spatch.tty.out --return --quiet --command "$command" - # provide a tty using "script", so I can have several spatch in parallel.
fi - # They may ignore INT and TERM; if you have to, use HUP.
- </dev/null &> /dev/null script --append $incdir/.spatch.tty.out --return --quiet --command "$command"
- fi
+ echo " GENCOCCIRULES .compat.cocci";
+ cat $incdir/.compat.cocci;
+
+ echo " SPATCH $chksum "$K
+ # Note: $* (or $@) is NOT make magic variable now, this is a shell script
+ # make $@, the target file, was passed as $1, and is now $compat_patch
+ # make $^, the source (and header) files spatch should operate on,
+ # are "the rest of the shell argument array", so after shifting the first
+ # argument away this is shell $@ respectively $* now.
+ # we know we don't have white-space in the argument list
+
+ command="spatch --sp-file $incdir/.compat.cocci $* --macro-file drbd-kernel-compat/cocci_macros.h --macro-file-builtins $coccilibpath/standard.h --iso-file $coccilibpath/standard.iso --very-quiet > $compat_patch.tmp 2> $incdir/.spatch.stderr;"
+ echo " SPATCH COMMAND $command ";
+
+ if test -t 0; then
+ $SHELL -c "$command"
+ else
+ # spatch is broken in a way: it "requires" a tty.
+ # provide a tty using "script", so I can have several spatch in parallel.
+ # They may ignore INT and TERM; if you have to, use HUP.
+ </dev/null &> /dev/null script --append $incdir/.spatch.tty.out --return --quiet --command "$command"
+ fi
else
- echo " SPATCH $chksum "$K" - nothing to do"
- touch $compat_patch.tmp
+ echo " SPATCH $chksum "$K" - nothing to do"
+ touch $compat_patch.tmp
+ fi
+ +
+ echo " GENSPATCHFILE $compat_patch.tmp "; + echo " GENSPATCHFILE $compat_patch.tmp ";
+ cat $compat_patch.tmp; + cat $compat_patch.tmp;
+ if [ -e $incdir/.spatch.stderr ]; then + if [ -e $incdir/.spatch.stderr ]; then
+ echo " GENSPATCHERR .spatch.stderr"; + echo " GENSPATCHERR .spatch.stderr";
+ cat $incdir/.spatch.stderr; + cat $incdir/.spatch.stderr;
+ fi fi
+ +
if [ -e $incdir/.compat.patch ]; then if [ -e $incdir/.compat.patch ]; then
cat $incdir/.compat.patch >> $compat_patch.tmp; cat $incdir/.compat.patch >> $compat_patch.tmp
fi; fi
diff -Naur drbd-9.0.20~1+git.7dce3c8b.orig/Makefile drbd-9.0.20~1+git.7dce3c8b/Makefile
--- drbd-9.0.20~1+git.7dce3c8b.orig/Makefile 2020-01-09 13:38:00.994984563 +0800
+++ drbd-9.0.20~1+git.7dce3c8b/Makefile 2020-01-09 13:41:50.512262670 +0800
@@ -310,9 +310,11 @@
endif
coccicheck: coccinelle/*.cocci
+ $(eval coccilibpath := $(shell rpm -ql coccinelle|grep standard.h|xargs dirname))
@for file in $^ ; do \
echo " COCCICHECK $$(basename $${file} .cocci)"; \
- spatch --very-quiet drbd/drbd_*.c -D $(MODE) --sp-file $${file}; \
+ spatch drbd/drbd_*.c --macro-file-builtins $(coccilibpath)/standard.h \
+ --iso-file $(coccilibpath)/standard.iso -D $(MODE) --sp-file $${file}; \
done
Makefile: ;