Skip to content

Commit

Permalink
Ticket #47809 - find a way to remove replication plugin errors messag…
Browse files Browse the repository at this point in the history
…es "changelog iteration code returned a dummy entry with csn %s, skipping ..."

Description:
1) Can't locate CSN %s in the changelog (DB rc=%d).
   Print the message once per one missing CSN.
2) changelog iteration code returned a dummy entry with csn %s, skipping ...
   Downgrade the log level to replication log level (SLAPI_LOG_REPL).

https://fedorahosted.org/389/ticket/47809

Reviewed by rmeggins@redhat.com (Thanks, Rich!)
(cherry picked from commit 6a1b10d)
  • Loading branch information
nhosoi committed Jun 12, 2014
1 parent 3e5c14a commit ddca54d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
11 changes: 8 additions & 3 deletions ldap/servers/plugins/replication/cl5_clcache.c
Expand Up @@ -111,6 +111,7 @@ struct clc_buffer {
DBT buf_data; /* data retrived from db */
void *buf_record_ptr; /* ptr to the current record in data */
CSN *buf_missing_csn; /* used to detect persistent missing of CSN */
CSN *buf_prev_missing_csn; /* used to surpress the repeated messages */

/* fields for control the CSN sequence sent to the consumer */
struct csn_seq_ctrl_block **buf_cscbs;
Expand Down Expand Up @@ -376,9 +377,12 @@ clcache_load_buffer ( CLC_Buffer *buf, CSN *anchorcsn, int flag )
else if ( anchorcsn ) {
/* Report error only when the missing is persistent */
if ( buf->buf_missing_csn && csn_compare (buf->buf_missing_csn, anchorcsn) == 0 ) {
slapi_log_error ( SLAPI_LOG_FATAL, buf->buf_agmt_name,
"Can't locate CSN %s in the changelog (DB rc=%d). The consumer may need to be reinitialized.\n",
(char*)buf->buf_key.data, rc );
if (!buf->buf_prev_missing_csn || csn_compare (buf->buf_prev_missing_csn, anchorcsn)) {
slapi_log_error ( SLAPI_LOG_FATAL, buf->buf_agmt_name,
"Can't locate CSN %s in the changelog (DB rc=%d). If replication stops, the consumer may need to be reinitialized.\n",
(char*)buf->buf_key.data, rc );
csn_dup_or_init_by_csn (&buf->buf_prev_missing_csn, anchorcsn);
}
}
else {
csn_dup_or_init_by_csn (&buf->buf_missing_csn, anchorcsn);
Expand Down Expand Up @@ -915,6 +919,7 @@ clcache_delete_buffer ( CLC_Buffer **buf )
slapi_ch_free (&( (*buf)->buf_data.data ));
csn_free (&( (*buf)->buf_current_csn ));
csn_free (&( (*buf)->buf_missing_csn ));
csn_free (&( (*buf)->buf_prev_missing_csn ));
slapi_ch_free ( (void **) buf );
}
}
Expand Down
16 changes: 8 additions & 8 deletions ldap/servers/plugins/replication/repl5_inc_protocol.c
Expand Up @@ -1707,15 +1707,15 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu
switch (rc)
{
case CL5_SUCCESS:
/* check that we don't return dummy entries */
if (is_dummy_operation (entry.op))
{
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
"%s: changelog iteration code returned a dummy entry with csn %s, "
"skipping ...\n",
/* check that we don't return dummy entries */
if (is_dummy_operation (entry.op))
{
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
"%s: changelog iteration code returned a dummy entry with csn %s, "
"skipping ...\n",
agmt_get_long_name(prp->agmt), csn_as_string(entry.op->csn, PR_FALSE, csn_str));
continue;
}
continue;
}
replay_crc = replay_update(prp, entry.op, &message_id);
if (message_id)
{
Expand Down

0 comments on commit ddca54d

Please sign in to comment.