-
Notifications
You must be signed in to change notification settings - Fork 205
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
Add stream IDs, proper storage prefixing, recovering from crashes. #177
Conversation
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.
I think it's high time we started commenting our code a bit more, because just by looking at the code, it is very difficult to understand what's happening in specific parts of the code. I think a two-liner saying "StreamID is ...." and "The transactions are now used in a way X instead of Y" would make reviewing a much more efficient, productive and easy job.
|
||
watermark, err := engine.watermarkSource.GetWatermark(ctx, sourcePrefixedTx) | ||
watermark, err := engine.watermarkSource.GetWatermark(ctx, tx) |
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.
This seems like a very subtle change, yet there is nothing that explains it. Could you add a comment, as to explain why the watermark is suddenly created using the original transaction, and not the prefixed one, as was in the previous version?
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.
I've added necessary comments.
if err != nil { | ||
return errors.Wrap(err, "couldn't get current watermark from source") | ||
} | ||
if watermark.After(engine.lastCommittedWatermark) { | ||
err := engine.irs.UpdateWatermark(ctx, tx, watermark) | ||
err := engine.irs.UpdateWatermark(ctx, prefixedTx, watermark) |
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.
Same thing here - these changes need commenting in my opinion
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.
I've added necessary comments.
No description provided.