Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F/merge proto #171

Merged
merged 5 commits into from
Jul 29, 2014
Merged

F/merge proto #171

merged 5 commits into from
Jul 29, 2014

Conversation

lbudai
Copy link
Collaborator

@lbudai lbudai commented Jul 24, 2014

No description provided.

lbudai and others added 5 commits July 25, 2014 12:50
Signed-off-by: Daniel Gados <gdani@balabit.hu>
Signed-off-by: Budai Laszlo <Laszlo.Budai@balabit.com>
…s side

Signed-off-by: Daniel Gados <gdani@balabit.hu>
Signed-off-by: Budai Laszlo <Laszlo.Budai@balabit.com>
Signed-off-by: Budai Laszlo <Laszlo.Budai@balabit.com>
It may happen that a message is sent to multiple destinations and
some of these destination have ack-ed the message but the queue of
the other writers have been freed. In this case these writers ack
the messages with AckType AT_ABORT which means that the message is
not processed and never will be.
To be correct we have to transfer the AT_ABORT all way along the
ack-path to notify the source that the message is not processed
on some paths and never will be to decrement the references to
the message. When the message is processed on all paths then the ack
is not only to decrement the references to the message but to change
the actual window size and save the actual buffer position to the
persist file.
The order of processed acks (AT_PROCESS) and unprocessed acks (AT_ABORT)
is undetermined. We have to accumulate the aborts and if at least one
writer acks with AT_ABORT (even if it is not the last one), we have to
transfer the AT_ABORT state to the source from log_msg_ack and
log_msg_refcache_stop.
To achive the above mentioned functionality the TLS_BLOCK has been
extended with a logmsg_cached_abort flag holding 0 or 1 and the member
ack_and_ref is change the following way: the lowest 15 bits hold the ref
counter (instead of 16 bits), then the next 15 bits hold the ack counter
(instead of 16 bits) and then 1 bit is holding the abort-flag (the last
one bit is unused at the moment).

test_logqueue: after changing the refcounter's size of logmsg the MESSAGES_PER_FEEDER is too high

Signed-off-by: Daniel Gados <gdani@balabit.hu>
Signed-off-by: Budai Laszlo <Laszlo.Budai@balabit.com>
… log_writer_flush

Signed-off-by: Daniel Gados <gdani@balabit.hu>
Signed-off-by: Budai Laszlo <Laszlo.Budai@balabit.com>
algernon added a commit that referenced this pull request Jul 29, 2014
@algernon algernon merged commit a5d9618 into syslog-ng:3.6/master Jul 29, 2014
@@ -123,6 +123,8 @@ TLS_BLOCK_START
gint logmsg_cached_refs;
/* number of cached acks by the current thread */
gint logmsg_cached_acks;
/* abort flag in the current thread for acks */
gint logmsg_cached_abort;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be a gboolean?

@bazsi
Copy link
Collaborator

bazsi commented Jul 30, 2014

this shouldn't go in as it is, or at least be fixed up. (I've just noticed it just has been merged).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants