-
Notifications
You must be signed in to change notification settings - Fork 466
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
F/merge proto #171
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>
@@ -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; | |||
} |
There was a problem hiding this comment.
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?
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.