Skip to content

Wire protocol improvement: prefetch blob info and some data when open blob#8307

Merged
hvlad merged 3 commits intov5.0-releasefrom
work/blob_prefetch
Nov 6, 2024
Merged

Wire protocol improvement: prefetch blob info and some data when open blob#8307
hvlad merged 3 commits intov5.0-releasefrom
work/blob_prefetch

Conversation

@hvlad
Copy link
Copy Markdown
Member

@hvlad hvlad commented Nov 5, 2024

This is the first part of wire protocol improvements with regards to reading blobs.

In this part I offer to group op_open_blob2, op_info_blob and op_get_segment logical packets into single physical packet.
It allows to prefetch and cache blob info and some blob data (up to 16KB currently) in single network roundtrip.
If application ask for blob info after open - return cached blob info without remote access.

This patch requires no protocol changes, no server code changes and should be fully compatible with older Firebird servers.

…ical packet.

It allows to prefetch and cache blob info and some blob data in single network roundtrip.
Return cached blob info, if present, without remote access.
@hvlad hvlad self-assigned this Nov 5, 2024
Comment thread src/remote/remote.cpp
Comment thread src/remote/remote.h
Comment thread src/common/utils_proto.h Outdated
Comment thread src/remote/client/interface.cpp Outdated
Comment thread src/common/utils_proto.h
Comment thread src/remote/remote.cpp Outdated
@hvlad hvlad merged commit bb2ba41 into v5.0-release Nov 6, 2024
@sim1984
Copy link
Copy Markdown
Contributor

sim1984 commented Nov 6, 2024

5.0.0? May be 5.0.2?

@hvlad
Copy link
Copy Markdown
Member Author

hvlad commented Nov 6, 2024

5.0.0? May be 5.0.2?

Sure, thanks

@WarmBooter
Copy link
Copy Markdown

It is valid to mention that initial tests in high latency network (ping 149ms) show an average transfer speed improvement of 33-49% with this patch.

Comment thread src/common/utils_proto.h
hvlad added a commit that referenced this pull request Nov 7, 2024
… blob (#8307)

* Group op_open_blob2, op_info_blob and op_get_segment into single physical packet.
It allows to prefetch and cache blob info and some blob data in single network roundtrip.
Return cached blob info, if present, without remote access.

* No need to reserve space for segment length.
Fixed typo.
Thanks to @dyemanov for comments.

* Add 'const' for parameter declaration, as @AlexPeshkoff suggested

* Use 'if constexpr' as @TreeHunter9 suggested.
Also, avoid hardcoded constants when possible.
@hvlad hvlad deleted the work/blob_prefetch branch November 12, 2024 11:01
@mrotteveel mrotteveel added the rlsnotes60: no Intentionally not added to the Firebird 6.0 release notes. label Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix-version: 5.0.2 fix-version: 6.0 Alpha 1 rlsnotes60: no Intentionally not added to the Firebird 6.0 release notes. type: improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants