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

READ EARLEST #3

Open
crotwell opened this issue Oct 25, 2021 · 4 comments
Open

READ EARLEST #3

crotwell opened this issue Oct 25, 2021 · 4 comments

Comments

@crotwell
Copy link

The protocol supports POSITION SET EARLIEST but might also be useful for debugging to support READ EARLIEST to get the earliest packet. And similar for READ LATEST.

Ringserver currently responds to READ EARLEST with error of Packet 0 not found in ring which doesn't make it clear if this is not part of the protocol, or if is just not implemented in ringserver/libdali.

@crotwell
Copy link
Author

Actually, ringserver responds with Error parsing READ command parameters which makes more sense. Bug in my script.

Still woudl be nice to have READ EARLEST.

@crotwell
Copy link
Author

Last comment, the reason for this idea...

You can fake it with POSITION EARLEST and then READ the returned packet id. However, in a busy ringserver with large data volume, the packet id returned might get flushed out of the ring before the read command can be sent. Hence a single op atomic READ EARLIEST and READ LATEST won't cause a race condition.

@chad-earthscope
Copy link
Contributor

Hence a single op atomic READ EARLIEST and READ LATEST won't cause a race condition.

Being pedantic: It's only atomic from the client perspective, it remains a race condition in the server, which has code to check that the positioning of a read and then a subsequent actual read of the packet got the same thing. Granted this would reduce the "misses" significantly compared to the time incurred in the network command transit. It's just not perfect, because it's always possible to skip off the end of a very busy ring.

@crotwell
Copy link
Author

crotwell commented Dec 1, 2023

Fair enough. And on reflection I am not sure how useful this actually is, so feel free to "won't fix" this unless you think it has use.

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

2 participants