Skip to content

Add option to disable footer caching to allow for large stream size without causing OOM in fadvise=RANDOM - #1740

Open
Animeshz wants to merge 2 commits into
GoogleCloudDataproc:masterfrom
Animeshz:animeshz/add-footer-cache-option
Open

Add option to disable footer caching to allow for large stream size without causing OOM in fadvise=RANDOM#1740
Animeshz wants to merge 2 commits into
GoogleCloudDataproc:masterfrom
Animeshz:animeshz/add-footer-cache-option

Conversation

@Animeshz

@Animeshz Animeshz commented Jun 9, 2026

Copy link
Copy Markdown

Context

Fixes #1734.

The connector by default assumes the file being read with fadvise=RANDOM is 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 if

  • File is not a columnar format
  • fs.gs.inputstream.min.range.request.size is a big size, such as 2GB, it'll allocate byte[] 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.

@google-cla

google-cla Bot commented Jun 9, 2026

Copy link
Copy Markdown

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sonarqubecloud

sonarqubecloud Bot commented Jun 9, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant