Add option to disable footer caching to allow for large stream size without causing OOM in fadvise=RANDOM - #1740
Conversation
…ithout causing OOM in fadvise=RANDOM
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request introduces the fs.gs.inputstream.footer.cache.enable configuration option to allow disabling the in-memory footer cache for HTTP and gRPC read channels, preventing large memory allocations when the minimum range request size is large. The review feedback highlights two efficiency issues where the connector still requests and downloads the entire footer range from GCS even when the footer cache is disabled in GoogleCloudStorageReadChannel and GoogleCloudStorageClientReadChannel. Additionally, a potential log flooding issue was identified in GoogleCloudStorageBidiReadChannel due to an INFO log being triggered on every read call when the cache is disabled, which should be lowered to a finer log level.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|



Context
Fixes #1734.
The connector by default assumes the file being read with
fadvise=RANDOMis a columnar format, which has metadata like schema, row-index, etc. at the footer. Hence caches the footer in memory, but this becomes an issue iffs.gs.inputstream.min.range.request.sizeis a big size, such as 2GB, it'll allocatebyte[]of size 2GB per thread (or total read-channels opened) which reads the footer.Therefore causing OOM.
Changes
Introduces option
fs.gs.inputstream.footer.cache.enable(default: true) to allow disabling the footer cache via the configuration option when not required.