Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Conversation

@soumyajit-sahu
Copy link
Contributor

Major Fix: Log loss scenario which happens when a Kafka connection error happens during re-balance and auto offset reset is enabled to latest

Change requests to use API version 0 instead of 1. This will let the library be usable in 0.9

Minor fixes: Some small logging bugs and performance related fix

…ad of

1, 3) Some minor performance improvement and bug fixes
Logger.InfoFormat("{2} : Updating fetch offset = {0} with value = {1}", this.fetchedOffset, offset, this.PartitionId);
this.chunkQueue.Add(new FetchedDataChunk(messages, this, this.fetchedOffset));
long newOffset = Interlocked.Exchange(ref this.fetchedOffset, offset);
Logger.Debug("Updated fetch offset of " + this + " to " + newOffset);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just fixing debug logging to show the right value

Copy link
Contributor

Choose a reason for hiding this comment

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

I identified what looked like a different bug here a few months ago: I think line 235 (Interlocked.Exchange...) needs to happen before line 234 (this.chunkQueue.Add...). This puts the this.fetchedOffset value is updated to the new offset before passing it off to the new FetchedDataChunk. Perhaps that fix can be done in a different PR, but I believe it should be done.
Thanks for making the logging change, though. That looks good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mhorstma while editing this file, I had looked at what FetchedDataChunk does with the fetchedOffset. I don't recall all very well, but the order seemed correct. Let us open another PR if we find bugs.

The logging was misleading because the Interchange.Exchange() returns the old value, and not the new offset value. So, I removed the "long newOffset" variable altogether. The debug logs should now be true :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants