Merge ~rafaeldtinoco/ubuntu/+source/crmsh:lp1895728-groovy into ubuntu/+source/crmsh:ubuntu/devel
- Git
- lp:~rafaeldtinoco/ubuntu/+source/crmsh
- lp1895728-groovy
- Merge into ubuntu/devel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Rafael David Tinoco | ||||
Approved revision: | 367f4f9ff8482b01e81792b747c639ed9699a272 | ||||
Merge reported by: | Christian Ehrhardt | ||||
Merged at revision: | 367f4f9ff8482b01e81792b747c639ed9699a272 | ||||
Proposed branch: | ~rafaeldtinoco/ubuntu/+source/crmsh:lp1895728-groovy | ||||
Merge into: | ubuntu/+source/crmsh:ubuntu/devel | ||||
Diff against target: |
434 lines (+370/-1) 9 files modified
debian/changelog (+12/-0) debian/control (+2/-1) debian/patches/series (+9/-0) debian/patches/ubuntu/lp1895728-669f13b5-Fix-bootstrap-Change-condition-to-add-stonith-sbd-re.patch (+40/-0) debian/patches/ubuntu/lp1895728-78ce77e4-Low-hb_report-Fix-collecting-of-binary-data-bsc-1166.patch (+128/-0) debian/patches/ubuntu/lp1895728-997f62d6-Fix-hb_report-disable-dump-all-tasks-stack-into-dmes.patch (+67/-0) debian/patches/ubuntu/lp1895728-ca1f0a7f-Fix-ui_resource-refresh-Tab-should-complete-resource.patch (+31/-0) debian/patches/ubuntu/lp1895728-cce28254-Fix-crmsh.spec-using-mktemp-to-create-tmp-file-bsc-1.patch (+30/-0) debian/patches/ubuntu/lp1895728-e098387e-Fix-bootstrap-use-csync2-f-option-correctly-bsc-1166.patch (+51/-0) |
||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Rafael David Tinoco (community) | Approve | ||
Bryce Harrington (community) | Approve | ||
Canonical Server | Pending | ||
Canonical Server Core Reviewers | Pending | ||
Review via email: mp+390841@code.launchpad.net |
Description of the change
Rafael David Tinoco (rafaeldtinoco) wrote : | # |
Rafael David Tinoco (rafaeldtinoco) wrote : | # |
Good for review whenever someone can. Thank you!
Bryce Harrington (bryce) wrote : | # |
* Changelog:
- [√] old content and logical tag match as expected
- [√] changelog entry correct version and targeted codename
- [√] changelog entries correct
- [√] update-maintainer has been run
* Actual changes:
- [ ] no upstream changes to consider
- [√] no further upstream version to consider
- [√] debian changes look safe
* Old Delta:
- [-] dropped changes are ok to be dropped
- [-] nothing else to drop
- [-] changes forwarded upstream/debian (if appropriate)
* New Delta:
- [-] no new patches added
- [√] patches match what was proposed upstream
- [√] patches correctly included in debian/
- [√] patches have correct DEP3 metadata
* Build/Test:
- [ ] build is ok
- [ ] verified PPA package installs/uninstalls
- [ ] autopkgtest against the PPA package passes
- [ ] sanity checks test fine
I didn't take time to run the tests or try the installation, but can do so tomorrow if desired. I assume if there were test issues, they'll show up in the autopkgtest runs.
* Code review on patches:
- ubuntu/
+ Code changes looks correct & safe
+ Fix Origin: url is incomplete (needs SHA appended)
+ "bsc#1166967" sounds like a bug tracker ticket but I could not find a public bug system with that identifier. If there is one, it would be useful to link to it via a "Bug: ..." DEP3 tag. From the upstream commit entry there's a link to the pull request which has some discussion, so lacking access to the 'bsc', you could add "Bug: https:/
- ubuntu/
+ Fix Origin: url is incomplete (needs SHA appended)
+ Add Bug: https:/
+ It looks like the important piece of this patch is dropping the "echo t > /proc/sysrq-
- ubuntu/
+ LGTM. Personally I'd use $() rather than `` but this is technically correct and using mktemp is a good improvement.
+ Fix Origin: url is incomplete (needs SHA appended)
+ Add Bug: https:/
- ubuntu/
+ Fix Origin: url is incomplete (needs SHA appended)
+ Add Bug: https:/
+ Code changes look good per the pull request, although I wonder if csync2_update() should throw an exception if the second `csync2 -rxv` fails, but the warning is at least an improvement over the prior code.
+ Just a nitpick but I notice this patch uses "synced" in one message and "sync'd" in another.
- ubuntu/
Rafael David Tinoco (rafaeldtinoco) wrote : | # |
> I didn't take time to run the tests or try the installation, but can do so
> tomorrow if desired. I assume if there were test issues, they'll show up in
> the autopkgtest runs.
I can test that Bryce, thanks a lot for reviewing this for me!
>
> * Code review on patches:
> - ubuntu/
> sbd-re.patch
> + Code changes looks correct & safe
> + Fix Origin: url is incomplete (needs SHA appended)
> + "bsc#1166967" sounds like a bug tracker ticket but I could not find a
> public bug system with that identifier. If there is one, it would be useful
> to link to it via a "Bug: ..." DEP3 tag. From the upstream commit entry
> there's a link to the pull request which has some discussion, so lacking
> access to the 'bsc', you could add "Bug:
> https:/
YES! I forgot about bsc# numbers and the original bug reference! These are: https:/
I have also forgotten to update the Origin with the commit SHAs. Doing that..
>
> - ubuntu/
> dmes.patch
> + Fix Origin: url is incomplete (needs SHA appended)
> + Add Bug: https:/
> + It looks like the important piece of this patch is dropping the "echo t
> > /proc/sysrq-
> add some process state info; dump_D_process() is running a few bash commands
> which feels a bit janky. Since this is not an SRU I think it's good enough,
> but if it was an SRU I'd suggest dropping dump_D_process() and carrying only
> the actual fix.
Yep, I don't find nice as well .. things like get_stdout("cat /proc/XXX").. I see your point and agree. For stabilization is good enough, as you said.
> - ubuntu/
> bsc-1.patch
> + LGTM. Personally I'd use $() rather than `` but this is technically
> correct and using mktemp is a good improvement.
> + Fix Origin: url is incomplete (needs SHA appended)
> + Add Bug: https:/
Alright.
> - ubuntu/
> bsc-1166.patch
> + Fix Origin: url is incomplete (needs SHA appended)
> + Add Bug: https:/
> + Code changes look good per the pull request, although I wonder if
> csync2_update() should throw an exception if the second `csync2 -rxv` fails,
> but the warning is at least an improvement over the prior code.
> + Just a nitpick but I notice this patch uses "synced" in one message and
> "sync'd" in another.
Yep :\. I tend not to change upstream unless we face the bug ourselves and suggest the changes. To be honest, bootstrap is something from crmsh we ...
Rafael David Tinoco (rafaeldtinoco) wrote : | # |
Okay, finished replying to your review, will force push and ask for a second quick look and then upload if you are +1 tomorrow. Thanks again Bryce!
Bryce Harrington (bryce) wrote : | # |
With Bug/Origin DEP3 tags fixed, giving it my +1.
Rafael David Tinoco (rafaeldtinoco) wrote : | # |
[rafaeldtinoco@
upload/
[rafaeldtinoco@
Enumerating objects: 27, done.
Counting objects: 100% (27/27), done.
Delta compression using up to 8 threads
Compressing objects: 100% (21/21), done.
Writing objects: 100% (21/21), 9.11 KiB | 9.11 MiB/s, done.
Total 21 (delta 9), reused 0 (delta 0), pack-reused 0
To ssh://git.
* [new tag] upload/
$ debdiff crmsh*.dsc | diffstat -l
changelog
control
patches/series
patches/
patches/
patches/
patches/
patches/
patches/
[rafaeldtinoco@
Checking signature on .changes
Uploading to ubuntu (via ftp to upload.ubuntu.com):
Uploading crmsh_4.
Uploading crmsh_4.
Uploading crmsh_4.
Uploading crmsh_4.
Successfully uploaded packages.
Christian Ehrhardt (paelzer) wrote : | # |
merged
crmsh | 4.2.0-3ubuntu1 | groovy | source, all
Preview Diff
1 | diff --git a/debian/changelog b/debian/changelog |
2 | index 858a74c..9b3ff70 100644 |
3 | --- a/debian/changelog |
4 | +++ b/debian/changelog |
5 | @@ -1,3 +1,15 @@ |
6 | +crmsh (4.2.0-3ubuntu1) groovy; urgency=medium |
7 | + |
8 | + * Fixes before release: (LP: #1895728) |
9 | + - [997f62d6] Fix: hb_report: disable dump all tasks stack into dmesg |
10 | + - [cce28254] Fix: crmsh.spec: using mktemp to create tmp file |
11 | + - [e098387e] Fix: bootstrap: use csync2 '-f' option correctly |
12 | + - [669f13b5] Fix: bootstrap: Change condition to add stonith-sbd resource |
13 | + - [ca1f0a7f] Fix: ui_resource: refresh <Tab> should complete resource first |
14 | + - [78ce77e4] Low: hb_report: Fix collecting of binary data |
15 | + |
16 | + -- Rafael David Tinoco <rafaeldtinoco@ubuntu.com> Wed, 16 Sep 2020 03:41:38 +0000 |
17 | + |
18 | crmsh (4.2.0-3) unstable; urgency=medium |
19 | |
20 | [ Debian Janitor ] |
21 | diff --git a/debian/control b/debian/control |
22 | index 4f9a87e..24a2782 100644 |
23 | --- a/debian/control |
24 | +++ b/debian/control |
25 | @@ -1,7 +1,8 @@ |
26 | Source: crmsh |
27 | Section: admin |
28 | Priority: optional |
29 | -Maintainer: Debian HA Maintainers <debian-ha-maintainers@lists.alioth.debian.org> |
30 | +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
31 | +XSBC-Original-Maintainer: Debian HA Maintainers <debian-ha-maintainers@lists.alioth.debian.org> |
32 | Uploaders: |
33 | Richard B Winters <rik@mmogp.com>, |
34 | Adrian Vondendriesch <adrian.vondendriesch@credativ.de>, |
35 | diff --git a/debian/patches/series b/debian/patches/series |
36 | index 94acfdf..07859a4 100644 |
37 | --- a/debian/patches/series |
38 | +++ b/debian/patches/series |
39 | @@ -11,3 +11,12 @@ |
40 | 0015-Fix-testsuite-errors.patch |
41 | 0016-Fix-python2-calls.patch |
42 | 0017-Fix-python3.8-unittest-compatibility.patch |
43 | +# |
44 | +# ubuntu: post release fixes (LP: #1895728) |
45 | +# |
46 | +ubuntu/lp1895728-997f62d6-Fix-hb_report-disable-dump-all-tasks-stack-into-dmes.patch |
47 | +ubuntu/lp1895728-cce28254-Fix-crmsh.spec-using-mktemp-to-create-tmp-file-bsc-1.patch |
48 | +ubuntu/lp1895728-e098387e-Fix-bootstrap-use-csync2-f-option-correctly-bsc-1166.patch |
49 | +ubuntu/lp1895728-669f13b5-Fix-bootstrap-Change-condition-to-add-stonith-sbd-re.patch |
50 | +ubuntu/lp1895728-ca1f0a7f-Fix-ui_resource-refresh-Tab-should-complete-resource.patch |
51 | +ubuntu/lp1895728-78ce77e4-Low-hb_report-Fix-collecting-of-binary-data-bsc-1166.patch |
52 | diff --git a/debian/patches/ubuntu/lp1895728-669f13b5-Fix-bootstrap-Change-condition-to-add-stonith-sbd-re.patch b/debian/patches/ubuntu/lp1895728-669f13b5-Fix-bootstrap-Change-condition-to-add-stonith-sbd-re.patch |
53 | new file mode 100644 |
54 | index 0000000..334a853 |
55 | --- /dev/null |
56 | +++ b/debian/patches/ubuntu/lp1895728-669f13b5-Fix-bootstrap-Change-condition-to-add-stonith-sbd-re.patch |
57 | @@ -0,0 +1,40 @@ |
58 | +From 669f13b518847287d9994e8f3a00ffd876b376df Mon Sep 17 00:00:00 2001 |
59 | +From: liangxin1300 <XLiang@suse.com> |
60 | +Date: Wed, 18 Mar 2020 20:15:08 +0800 |
61 | +Subject: [PATCH] Fix: bootstrap: Change condition to add stonith-sbd |
62 | + resource(bsc#1166967) |
63 | + |
64 | +Origin: upstream, https://github.com/ClusterLabs/crmsh/commit/669f13b518847287d9994e8f3a00ffd876b376df |
65 | +Bug: https://github.com/ClusterLabs/crmsh/pull/545 |
66 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1895728 |
67 | +Reviewed-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com> |
68 | +Last-Update: 2020-09-15 |
69 | +--- |
70 | + crmsh/bootstrap.py | 4 ++-- |
71 | + 1 file changed, 2 insertions(+), 2 deletions(-) |
72 | + |
73 | +diff --git a/crmsh/bootstrap.py b/crmsh/bootstrap.py |
74 | +index 36d5149f..db78b7dd 100644 |
75 | +--- a/crmsh/bootstrap.py |
76 | ++++ b/crmsh/bootstrap.py |
77 | +@@ -660,7 +660,7 @@ def init_cluster_local(): |
78 | + |
79 | + # for cluster join, diskless_sbd flag is set in join_cluster() if |
80 | + # sbd is running on seed host |
81 | +- if configured_sbd_device() or _context.diskless_sbd: |
82 | ++ if (configured_sbd_device() and _context.sbd_device) or _context.diskless_sbd: |
83 | + invoke("systemctl enable sbd.service") |
84 | + else: |
85 | + invoke("systemctl disable sbd.service") |
86 | +@@ -1496,7 +1496,7 @@ op_defaults op-options: timeout=600 record-pending=true |
87 | + rsc_defaults rsc-options: resource-stickiness=1 migration-threshold=3 |
88 | + """) |
89 | + |
90 | +- if configured_sbd_device(): |
91 | ++ if configured_sbd_device() and _context.sbd_device: |
92 | + if not invoke("crm configure primitive stonith-sbd stonith:external/sbd pcmk_delay_max=30s"): |
93 | + error("Can't create stonith-sbd primitive") |
94 | + if not invoke("crm configure property stonith-enabled=true"): |
95 | +-- |
96 | +2.27.0 |
97 | + |
98 | diff --git a/debian/patches/ubuntu/lp1895728-78ce77e4-Low-hb_report-Fix-collecting-of-binary-data-bsc-1166.patch b/debian/patches/ubuntu/lp1895728-78ce77e4-Low-hb_report-Fix-collecting-of-binary-data-bsc-1166.patch |
99 | new file mode 100644 |
100 | index 0000000..54206a3 |
101 | --- /dev/null |
102 | +++ b/debian/patches/ubuntu/lp1895728-78ce77e4-Low-hb_report-Fix-collecting-of-binary-data-bsc-1166.patch |
103 | @@ -0,0 +1,128 @@ |
104 | +From 78ce77e47b195fc2ef4a21d5d83886b178bbc0e1 Mon Sep 17 00:00:00 2001 |
105 | +From: Petr Pavlu <petr.pavlu@suse.com> |
106 | +Date: Mon, 23 Mar 2020 13:19:20 +0100 |
107 | +Subject: [PATCH] Low: hb_report: Fix collecting of binary data (bsc#1166962) |
108 | + |
109 | +When creating a resulting archive in a slave collector ('hb_report |
110 | +__slave'), the code tried to decode output produced by the tar utility |
111 | +as a UTF-8 string (crmutils.get_stdout_stderr() -> to_ascii()). This |
112 | +corrupted any binary files in the archive, such as gzipped pengine |
113 | +files. |
114 | + |
115 | +The patch fixes the problem by obtaining the output from the tar utility |
116 | +as a bytes object and writing it in the repr() form on stdout of the |
117 | +slave collector. Similarly, the receiving side is updated to accept this |
118 | +format. |
119 | + |
120 | +Origin: upstream, https://github.com/ClusterLabs/crmsh/commit/78ce77e47b195fc2ef4a21d5d83886b178bbc0e1 |
121 | +Bug: https://github.com/ClusterLabs/crmsh/pull/610 |
122 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1895728 |
123 | +Reviewed-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com> |
124 | +Last-Update: 2020-09-15 |
125 | +--- |
126 | + crmsh/utils.py | 8 ++++++-- |
127 | + hb_report/constants.py | 1 + |
128 | + hb_report/hb_report.in | 7 ++----- |
129 | + hb_report/utillib.py | 17 ++++++++++------- |
130 | + 4 files changed, 19 insertions(+), 14 deletions(-) |
131 | + |
132 | +diff --git a/crmsh/utils.py b/crmsh/utils.py |
133 | +index fe08859c..04805734 100644 |
134 | +--- a/crmsh/utils.py |
135 | ++++ b/crmsh/utils.py |
136 | +@@ -725,7 +725,7 @@ def pipe_cmd_nosudo(cmd): |
137 | + return rc |
138 | + |
139 | + |
140 | +-def get_stdout(cmd, input_s=None, stderr_on=True, shell=True): |
141 | ++def get_stdout(cmd, input_s=None, stderr_on=True, shell=True, raw=False): |
142 | + ''' |
143 | + Run a cmd, return stdout output. |
144 | + Optional input string "input_s". |
145 | +@@ -743,10 +743,12 @@ def get_stdout(cmd, input_s=None, stderr_on=True, shell=True): |
146 | + stdout=subprocess.PIPE, |
147 | + stderr=stderr) |
148 | + stdout_data, stderr_data = proc.communicate(input_s) |
149 | ++ if raw: |
150 | ++ return proc.returncode, stdout_data |
151 | + return proc.returncode, to_ascii(stdout_data).strip() |
152 | + |
153 | + |
154 | +-def get_stdout_stderr(cmd, input_s=None, shell=True): |
155 | ++def get_stdout_stderr(cmd, input_s=None, shell=True, raw=False): |
156 | + ''' |
157 | + Run a cmd, return (rc, stdout, stderr) |
158 | + ''' |
159 | +@@ -758,6 +760,8 @@ def get_stdout_stderr(cmd, input_s=None, shell=True): |
160 | + stdout=subprocess.PIPE, |
161 | + stderr=subprocess.PIPE) |
162 | + stdout_data, stderr_data = proc.communicate(input_s) |
163 | ++ if raw: |
164 | ++ return proc.returncode, stdout_data, stderr_data |
165 | + return proc.returncode, to_ascii(stdout_data).strip(), to_ascii(stderr_data).strip() |
166 | + |
167 | + |
168 | +diff --git a/hb_report/constants.py b/hb_report/constants.py |
169 | +index c2d3925f..2d5cb346 100644 |
170 | +--- a/hb_report/constants.py |
171 | ++++ b/hb_report/constants.py |
172 | +@@ -8,6 +8,7 @@ ARGOPTS_VALUE = "f:t:l:u:X:p:L:e:E:n:MSDZVsvhdQ" |
173 | + B_CONF = None |
174 | + CIB_DIR = None |
175 | + COMPRESS = config.report.compress |
176 | ++COMPRESS_DATA_FLAG = "COMPRESS HB_REPORT DATA:::" |
177 | + COMPRESS_PROG = "" |
178 | + COMPRESS_EXT = "" |
179 | + CORES_DIRS = None |
180 | +diff --git a/hb_report/hb_report.in b/hb_report/hb_report.in |
181 | +index 49138668..4dc1eabd 100755 |
182 | +--- a/hb_report/hb_report.in |
183 | ++++ b/hb_report/hb_report.in |
184 | +@@ -280,13 +280,10 @@ def run(): |
185 | + # problem description template, and prints final notes |
186 | + # |
187 | + if is_collector(): |
188 | +- import io |
189 | +- sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') |
190 | +- |
191 | + utillib.collect_info() |
192 | + cmd = r"cd %s/.. && tar -h -cf - %s" % (constants.WORKDIR, constants.WE) |
193 | +- code, out, err = crmutils.get_stdout_stderr(cmd) |
194 | +- print(out) |
195 | ++ code, out, err = crmutils.get_stdout_stderr(cmd, raw=True) |
196 | ++ print("{}{}".format(constants.COMPRESS_DATA_FLAG, out)) |
197 | + else: |
198 | + p_list = [] |
199 | + p_list.append(multiprocessing.Process(target=utillib.analyze)) |
200 | +diff --git a/hb_report/utillib.py b/hb_report/utillib.py |
201 | +index 9ca08991..0ee1ffa0 100644 |
202 | +--- a/hb_report/utillib.py |
203 | ++++ b/hb_report/utillib.py |
204 | +@@ -1548,14 +1548,17 @@ def start_slave_collector(node, arg_str): |
205 | + log_warning(err) |
206 | + break |
207 | + |
208 | ++ compress_data = "" |
209 | ++ for data in out.split('\n'): |
210 | ++ if data.startswith(constants.COMPRESS_DATA_FLAG): |
211 | ++ # hb_report data from collector |
212 | ++ compress_data = data.lstrip(constants.COMPRESS_DATA_FLAG) |
213 | ++ else: |
214 | ++ # log data from collector |
215 | ++ print(data) |
216 | ++ |
217 | + cmd = r"(cd {} && tar xf -)".format(constants.WORKDIR) |
218 | +- # typeof out here will always "str" |
219 | +- # input_s of get_stdout will always need bytes |
220 | +- # different situation depend on whether found pe file |
221 | +- if out.startswith("b'"): |
222 | +- crmutils.get_stdout(cmd, input_s=eval(out)) |
223 | +- else: |
224 | +- crmutils.get_stdout(cmd, input_s=out.encode('utf-8')) |
225 | ++ crmutils.get_stdout(cmd, input_s=eval(compress_data)) |
226 | + |
227 | + |
228 | + def str_to_bool(v): |
229 | +-- |
230 | +2.27.0 |
231 | + |
232 | diff --git a/debian/patches/ubuntu/lp1895728-997f62d6-Fix-hb_report-disable-dump-all-tasks-stack-into-dmes.patch b/debian/patches/ubuntu/lp1895728-997f62d6-Fix-hb_report-disable-dump-all-tasks-stack-into-dmes.patch |
233 | new file mode 100644 |
234 | index 0000000..9ee9e44 |
235 | --- /dev/null |
236 | +++ b/debian/patches/ubuntu/lp1895728-997f62d6-Fix-hb_report-disable-dump-all-tasks-stack-into-dmes.patch |
237 | @@ -0,0 +1,67 @@ |
238 | +From 997f62d6ac86b388f464642c1e7db8d5205d21e6 Mon Sep 17 00:00:00 2001 |
239 | +From: liangxin1300 <XLiang@suse.com> |
240 | +Date: Fri, 29 Nov 2019 10:14:28 +0800 |
241 | +Subject: [PATCH] Fix: hb_report: disable dump all tasks stack into |
242 | + dmesg(bsc#1158060) |
243 | + |
244 | +We ever added this line to collect all process back-traces for helping to analyze a ocfs2 cluster hang problem, |
245 | +but in some actual production environments, there are lots of processes in a cluster node, |
246 | +this dump operation will take too much time, even bring a short system hang. |
247 | +Then, we should delete this operation during a generic cluster information collection. |
248 | + |
249 | +Origin: upstream, https://github.com/ClusterLabs/crmsh/commit/997f62d6ac86b388f464642c1e7db8d5205d21e6 |
250 | +Bug: https://github.com/ClusterLabs/crmsh/pull/486 |
251 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1895728 |
252 | +Reviewed-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com> |
253 | +Last-Update: 2020-09-15 |
254 | +--- |
255 | + hb_report/utillib.py | 23 +++++++++++++++++++++-- |
256 | + 1 file changed, 21 insertions(+), 2 deletions(-) |
257 | + |
258 | +diff --git a/hb_report/utillib.py b/hb_report/utillib.py |
259 | +index 69383717..9ca08991 100644 |
260 | +--- a/hb_report/utillib.py |
261 | ++++ b/hb_report/utillib.py |
262 | +@@ -1649,11 +1649,29 @@ def time_status(): |
263 | + time_f = os.path.join(constants.WORKDIR, constants.TIME_F) |
264 | + crmutils.str2file(out_string, time_f) |
265 | + |
266 | ++ |
267 | ++def dump_D_process(): |
268 | ++ ''' |
269 | ++ dump D-state process stack |
270 | ++ ''' |
271 | ++ out_string = "" |
272 | ++ _, out, _ = crmutils.get_stdout_stderr("ps aux|awk '$8 ~ /^D/{print $2}'") |
273 | ++ len_D_process = len(out.split('\n')) if out else 0 |
274 | ++ out_string += "Dump D-state process stack: {}\n".format(len_D_process) |
275 | ++ if len_D_process == 0: |
276 | ++ return out_string |
277 | ++ for pid in out.split('\n'): |
278 | ++ _, cmd_out, _ = crmutils.get_stdout_stderr("cat /proc/{}/comm".format(pid)) |
279 | ++ out_string += "pid: {} comm: {}\n".format(pid, cmd_out) |
280 | ++ _, stack_out, _ = crmutils.get_stdout_stderr("cat /proc/{}/stack".format(pid)) |
281 | ++ out_string += stack_out + "\n\n" |
282 | ++ return out_string |
283 | ++ |
284 | ++ |
285 | + def dump_ocfs2(): |
286 | + ocfs2_f = os.path.join(constants.WORKDIR, constants.OCFS2_F) |
287 | + with open(ocfs2_f, "w") as f: |
288 | +- #dump all tasks stack into dmesg |
289 | +- os.system("echo t > /proc/sysrq-trigger") |
290 | ++ f.write(dump_D_process()) |
291 | + |
292 | + cmds = [ "dmesg", "ps -efL", "lsof", |
293 | + "lsblk -o 'NAME,KNAME,MAJ:MIN,FSTYPE,LABEL,RO,RM,MODEL,SIZE,OWNER,GROUP,MODE,ALIGNMENT,MIN-IO,OPT-IO,PHY-SEC,LOG-SEC,ROTA,SCHED,MOUNTPOINT'", |
294 | +@@ -1670,6 +1688,7 @@ def dump_ocfs2(): |
295 | + f.write("# %s\n"%(cmd)) |
296 | + f.write(out) |
297 | + |
298 | ++ |
299 | + def touch_dc(): |
300 | + if constants.SKIP_LVL: |
301 | + return |
302 | +-- |
303 | +2.27.0 |
304 | + |
305 | diff --git a/debian/patches/ubuntu/lp1895728-ca1f0a7f-Fix-ui_resource-refresh-Tab-should-complete-resource.patch b/debian/patches/ubuntu/lp1895728-ca1f0a7f-Fix-ui_resource-refresh-Tab-should-complete-resource.patch |
306 | new file mode 100644 |
307 | index 0000000..a65a61d |
308 | --- /dev/null |
309 | +++ b/debian/patches/ubuntu/lp1895728-ca1f0a7f-Fix-ui_resource-refresh-Tab-should-complete-resource.patch |
310 | @@ -0,0 +1,31 @@ |
311 | +From ca1f0a7fb5c424a406b7f85dd9903c4508f0c963 Mon Sep 17 00:00:00 2001 |
312 | +From: liangxin1300 <XLiang@suse.com> |
313 | +Date: Sun, 29 Mar 2020 19:48:38 +0800 |
314 | +Subject: [PATCH] Fix: ui_resource: refresh <Tab> should complete resource |
315 | + first(bsc#1167220) |
316 | + |
317 | +Origin: upstream, https://github.com/ClusterLabs/crmsh/commit/ca1f0a7fb5c424a406b7f85dd9903c4508f0c963 |
318 | +Bug: https://bugzilla.opensuse.org/show_bug.cgi?id=1167220 |
319 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1895728 |
320 | +Reviewed-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com> |
321 | +Last-Update: 2020-09-15 |
322 | +--- |
323 | + crmsh/ui_resource.py | 2 +- |
324 | + 1 file changed, 1 insertion(+), 1 deletion(-) |
325 | + |
326 | +diff --git a/crmsh/ui_resource.py b/crmsh/ui_resource.py |
327 | +index f8dee734..e52797a3 100644 |
328 | +--- a/crmsh/ui_resource.py |
329 | ++++ b/crmsh/ui_resource.py |
330 | +@@ -604,7 +604,7 @@ class RscMgmt(command.UI): |
331 | + rsc, cmd, attr, value) |
332 | + |
333 | + @command.alias('reprobe') |
334 | +- @command.completers(compl.nodes) |
335 | ++ @command.completers(compl.resources, compl.nodes) |
336 | + def do_refresh(self, context, rsc=None, node=None, force=False): |
337 | + 'usage: refresh [<rsc>] [<node>] [force]' |
338 | + return self._refresh_cleanup("refresh", rsc, node, force) |
339 | +-- |
340 | +2.27.0 |
341 | + |
342 | diff --git a/debian/patches/ubuntu/lp1895728-cce28254-Fix-crmsh.spec-using-mktemp-to-create-tmp-file-bsc-1.patch b/debian/patches/ubuntu/lp1895728-cce28254-Fix-crmsh.spec-using-mktemp-to-create-tmp-file-bsc-1.patch |
343 | new file mode 100644 |
344 | index 0000000..b3aaa5f |
345 | --- /dev/null |
346 | +++ b/debian/patches/ubuntu/lp1895728-cce28254-Fix-crmsh.spec-using-mktemp-to-create-tmp-file-bsc-1.patch |
347 | @@ -0,0 +1,30 @@ |
348 | +From cce28254b3b17c9a4ecdfce1012fb41f1f1abc78 Mon Sep 17 00:00:00 2001 |
349 | +From: liangxin1300 <XLiang@suse.com> |
350 | +Date: Tue, 7 Jan 2020 09:25:19 +0800 |
351 | +Subject: [PATCH] Fix: crmsh.spec: using mktemp to create tmp file(bsc#1154163) |
352 | + |
353 | +Origin: upstream, https://github.com/ClusterLabs/crmsh/commit/cce28254b3b17c9a4ecdfce1012fb41f1f1abc78 |
354 | +Bug: https://bugzilla.opensuse.org/show_bug.cgi?id=1154163 |
355 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1895728 |
356 | +Reviewed-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com> |
357 | +Last-Update: 2020-09-15 |
358 | +--- |
359 | + crmsh.spec.in | 2 +- |
360 | + 1 file changed, 1 insertion(+), 1 deletion(-) |
361 | + |
362 | +diff --git a/crmsh.spec.in b/crmsh.spec.in |
363 | +index f6553b33..18cf5b1f 100644 |
364 | +--- a/crmsh.spec.in |
365 | ++++ b/crmsh.spec.in |
366 | +@@ -201,7 +201,7 @@ fi |
367 | + # Run regression tests after installing the package |
368 | + # NB: this is called twice by OBS, that's why we touch the file |
369 | + %post test |
370 | +-testfile=/tmp/.crmsh_regression_tests_ran |
371 | ++testfile=`mktemp -t .crmsh_regression_tests_ran_XXXXXX` |
372 | + # check if time in file is less than 2 minutes ago |
373 | + if [ -e $testfile ] && [ "$(( $(date +%s) - $(cat $testfile) ))" -lt 120 ]; then |
374 | + echo "Skipping regression tests..." |
375 | +-- |
376 | +2.27.0 |
377 | + |
378 | diff --git a/debian/patches/ubuntu/lp1895728-e098387e-Fix-bootstrap-use-csync2-f-option-correctly-bsc-1166.patch b/debian/patches/ubuntu/lp1895728-e098387e-Fix-bootstrap-use-csync2-f-option-correctly-bsc-1166.patch |
379 | new file mode 100644 |
380 | index 0000000..3bcfcc7 |
381 | --- /dev/null |
382 | +++ b/debian/patches/ubuntu/lp1895728-e098387e-Fix-bootstrap-use-csync2-f-option-correctly-bsc-1166.patch |
383 | @@ -0,0 +1,51 @@ |
384 | +From e098387e2ae79893cfff3ad91d5a6e26d62ecfc8 Mon Sep 17 00:00:00 2001 |
385 | +From: liangxin1300 <XLiang@suse.com> |
386 | +Date: Sun, 15 Mar 2020 09:27:44 +0800 |
387 | +Subject: [PATCH] Fix: bootstrap: use csync2 '-f' option correctly(bsc#1166684) |
388 | + |
389 | +Origin: upstream, https://github.com/ClusterLabs/crmsh/commit/e098387e2ae79893cfff3ad91d5a6e26d62ecfc8 |
390 | +Bug: https://github.com/ClusterLabs/crmsh/pull/542 |
391 | +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1895728 |
392 | +Reviewed-by: Rafael David Tinoco <rafaeldtinoco@ubuntu.com> |
393 | +Last-Update: 2020-09-15 |
394 | +--- |
395 | + crmsh/bootstrap.py | 16 ++++++++++++---- |
396 | + 1 file changed, 12 insertions(+), 4 deletions(-) |
397 | + |
398 | +diff --git a/crmsh/bootstrap.py b/crmsh/bootstrap.py |
399 | +index e8e00cda..14e61066 100644 |
400 | +--- a/crmsh/bootstrap.py |
401 | ++++ b/crmsh/bootstrap.py |
402 | +@@ -784,9 +784,17 @@ include /etc/pacemaker/authkey; |
403 | + |
404 | + |
405 | + def csync2_update(path): |
406 | +- invoke("csync2 -rm %s" % (path)) |
407 | +- invoke("csync2 -rf %s" % (path)) |
408 | +- invoke("csync2 -rxv %s" % (path)) |
409 | ++ ''' |
410 | ++ Sync path to all peers |
411 | ++ |
412 | ++ If there was a conflict, use '-f' to force this side to win |
413 | ++ ''' |
414 | ++ invoke("csync2 -rm {}".format(path)) |
415 | ++ if invoke("csync2 -rxv {}".format(path)): |
416 | ++ return |
417 | ++ invoke("csync2 -rf {}".format(path)) |
418 | ++ if not invoke("csync2 -rxv {}".format(path)): |
419 | ++ warn("{} was not synced".format(path)) |
420 | + |
421 | + |
422 | + def init_csync2_remote(): |
423 | +@@ -1740,7 +1748,7 @@ def join_csync2(seed_host): |
424 | + # they haven't gone to all nodes in the cluster, which means a |
425 | + # subseqent join of another node can fail its sync of corosync.conf |
426 | + # when it updates expected_votes. Grrr... |
427 | +- if not invoke('ssh -o StrictHostKeyChecking=no root@%s "csync2 -mr / ; csync2 -fr / ; csync2 -xv"' % (seed_host)): |
428 | ++ if not invoke('ssh -o StrictHostKeyChecking=no root@{} "csync2 -rm /; csync2 -rxv || csync2 -rf / && csync2 -rxv"'.format(seed_host)): |
429 | + print("") |
430 | + warn("csync2 run failed - some files may not be sync'd") |
431 | + |
432 | +-- |
433 | +2.27.0 |
434 | + |
I'm bringing released fixes to crmsh because it is our tool of choice for cluster management (until PCS becomes the chosen one). I have tested this change with autopkgtest locally and had faced issues just because autopkgtest brakes the testbed (you have to completely uninstall corosync/ pacemaker/ crmsh and install them again in order to have a good test run).