Skip to content

Commit 96036fa

Browse files
committed
Log: based: Drop redundant messages from based_diff_notify()
There's a message near the end of cib_process_request() that tells us almost exactly the same things. The only thing that seems to be missing is the pre-operation CIB versions. I don't think that's a big loss. The only caller of based_diff_notify() is cib_process_command(). The message in cib_process_request() gets logged shortly after the sole call to cib_process_command(). So any time the based_diff_notify() message would have been logged, the remaining one in cib_process_request() will be too. Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
1 parent b9c77de commit 96036fa

1 file changed

Lines changed: 1 addition & 36 deletions

File tree

daemons/based/based_notify.c

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2004-2025 the Pacemaker project contributors
2+
* Copyright 2004-2026 the Pacemaker project contributors
33
*
44
* The version control history for this file may have further details.
55
*
@@ -155,48 +155,13 @@ based_diff_notify(const char *op, int result, const char *call_id,
155155
const char *client_id, const char *client_name,
156156
const char *origin, xmlNode *update, xmlNode *diff)
157157
{
158-
int source[] = { 0, 0, 0 };
159-
int target[] = { 0, 0, 0 };
160-
161-
uint8_t log_level = LOG_TRACE;
162-
163158
xmlNode *update_msg = NULL;
164159
xmlNode *wrapper = NULL;
165160

166161
if (diff == NULL) {
167162
return;
168163
}
169164

170-
if (result != pcmk_ok) {
171-
log_level = LOG_WARNING;
172-
}
173-
174-
/* @TODO Check return code? How should we handle an error? Are these log
175-
* messages even useful?
176-
*/
177-
pcmk__xml_patchset_versions(diff, source, target);
178-
179-
if ((source[0] != target[0])
180-
|| (source[1] != target[1])
181-
|| (source[2] != target[2])) {
182-
183-
do_crm_log(log_level,
184-
"Updated CIB generation %d.%d.%d to %d.%d.%d from client "
185-
"%s%s%s (%s) (%s)",
186-
source[0], source[1], source[2],
187-
target[0], target[1], target[2], client_name,
188-
((call_id != NULL)? " call " : ""), pcmk__s(call_id, ""),
189-
pcmk__s(origin, "unspecified peer"), pcmk_strerror(result));
190-
191-
} else if ((target[0] != 0) || (target[1] != 0) || (target[2] != 0)) {
192-
do_crm_log(log_level,
193-
"Local-only change to CIB generation %d.%d.%d from client "
194-
"%s%s%s (%s) (%s)",
195-
target[0], target[1], target[2], client_name,
196-
((call_id != NULL)? " call " : ""), pcmk__s(call_id, ""),
197-
pcmk__s(origin, "unspecified peer"), pcmk_strerror(result));
198-
}
199-
200165
update_msg = pcmk__xe_create(NULL, PCMK__XE_NOTIFY);
201166

202167
pcmk__xe_set(update_msg, PCMK__XA_T, PCMK__VALUE_CIB_NOTIFY);

0 commit comments

Comments
 (0)