Skip to content

Conversation

@hhwyt
Copy link

@hhwyt hhwyt commented Nov 21, 2025

Address #14137.

Summary: This change adds an allow_write option to IngestExternalFileOptions to allow writes to the DB during file ingestion. Previously, ingestion always blocked writes by entering write threads. With this option enabled, write operations can proceed concurrently with ingestion.

The main changes are in DBImpl::IngestExternalFile to conditionally skip blocking write threads based on the allow_write flag:

  • Skip EnterUnbatched on write threads when allow_write=true
  • Pass !allow_write as entered_write_thread to flush operations
  • Skip WaitForPendingWrites when allow_write=true
  • Skip ExitUnbatched when allow_write=true

Additionally:

  • Add validation to ensure consistent allow_write across all ingestion arguments in a batch
  • Update IngestExternalFileOptions with allow_write field (default false)

Users must ensure no writes overlap with the ingested data when using this option. This is useful for maintaining write availability during bulk data ingestion operations in scenarios where the ingested data does not conflict with ongoing writes.

Test Plan: Updated all existing test cases in external_sst_file_test.cc to support the new parameter with default value (false). All 202 tests pass successfully.

@meta-cla
Copy link

meta-cla bot commented Nov 21, 2025

Hi @hhwyt!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Summary: This change adds an `allow_write` option to
IngestExternalFileOptions to allow writes to the DB during file
ingestion. Previously, ingestion always blocked writes by entering
write threads. With this option enabled, write operations can proceed
concurrently with ingestion.

The main changes are in DBImpl::IngestExternalFile to conditionally
skip blocking write threads based on the `allow_write` flag:
* Skip EnterUnbatched on write threads when allow_write=true
* Pass !allow_write as entered_write_thread to flush operations
* Skip WaitForPendingWrites when allow_write=true
* Skip ExitUnbatched when allow_write=true

Additionally:
* Add validation to ensure consistent allow_write across all ingestion
  arguments in a batch
* Update IngestExternalFileOptions with allow_write field (default false)

Users must ensure no writes overlap with the ingested data when using
this option. This is useful for maintaining write availability during
bulk data ingestion operations in scenarios where the ingested data
does not conflict with ongoing writes.

Test Plan: Updated all existing test cases in external_sst_file_test.cc
to support the new parameter with default value (false). All 202 tests
pass successfully.

Signed-off-by: hhwyt <hhwyt1@gmail.com>
@hhwyt hhwyt force-pushed the allow-writes-during-ingestion branch from 869784e to 0ad4112 Compare November 21, 2025 06:57
@meta-cla meta-cla bot added the CLA Signed label Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant