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

Appender's resetPosition uses approximate last sequence number #1269

Open
alamar opened this issue Dec 14, 2022 · 0 comments
Open

Appender's resetPosition uses approximate last sequence number #1269

alamar opened this issue Dec 14, 2022 · 0 comments

Comments

@alamar
Copy link
Contributor

alamar commented Dec 14, 2022

Found when debugging ChronicleEnterprise/Chronicle-Queue-Enterprise#333

StoreAppender.writeBytesInternal() will call resetPosition every time (which may be wasteful), but it will also assign wire.headerNumber to store.approximateLastSequenceNumber, which is as its name implies approximate, and may return invalid value when queue is closed after process crash.

This does not seem optimal, but for some reason store.exactLastSequenceNumber call is prohibitively expensive to be used there. In many cases it would resort to sequential scanning of queue, which should be almost always unnecessary.

If this problem is fixed then check introduced in ChronicleEnterprise/Chronicle-Queue-Enterprise#333 may be removed.

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

No branches or pull requests

1 participant