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 · 2 comments
Open

Appender's resetPosition uses approximate last sequence number #1269

alamar opened this issue Dec 14, 2022 · 2 comments
Labels

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.

@yevgenp
Copy link
Contributor

yevgenp commented Jun 20, 2024

Is it still an issue after @nicktindall fixed #1538 ?
There is no store.approximateLastSequenceNumber anymore.

@nicktindall
Copy link
Contributor

All calls to lastSequenceNumber while holding a read lock should be accurate after #1537. There's no approximate/exact anymore.

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

No branches or pull requests

4 participants