Skip to content

Conversation

anand1976
Copy link
Contributor

If user_defined_index_factory in BlockBasedTableOptions is configured and we try to open an SST file without the corresponding UDI (either during DB open or file ingestion), ignore a failure to load the UDI by default. If fail_if_no_udi_on_open in BlockBasedTableOptions is true, then treat it as a fatal error.

Test plan:
Update unit tests

@meta-cla meta-cla bot added the CLA Signed label Sep 5, 2025
Copy link

@xingbowang xingbowang left a comment

Choose a reason for hiding this comment

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

Do we need to add anything around read path, so when udi flag is enabled on read path, but udi failed to load, read path would just ignore it.

RecordTick(rep_->ioptions.statistics.get(),
SST_USER_DEFINED_INDEX_LOAD_FAIL_COUNT);
if (table_options.fail_if_no_udi_on_open) {
s = Status::Corruption("Failed to load UDI: " + udi_name, s.ToString());
Copy link
Member

@cbi42 cbi42 Sep 5, 2025

Choose a reason for hiding this comment

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

Minor: this overwrites the failure where the UDI block is available but creating a reader on it failed. Similarly for below we overwrite the status to ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The original status is captured in the string message. This way, we can provide some additional info such as the index name and file name.

Copy link
Member

Choose a reason for hiding this comment

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

Ah I missed the s.ToString() part. Do we want to overwrite status to ok when UDI is present but fail to create index reader?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If fail_if_no_udi_on_open is false, I'm overwriting status to ok no matter why it failed. That's a good question though. Let me double check if ignoring failure only if the UDI is not present in the file is the desired behavior.

@anand1976
Copy link
Contributor Author

Do we need to add anything around read path, so when udi flag is enabled on read path, but udi failed to load, read path would just ignore it.

In the read path, we continue to return error since the user explicitly requested the UDI. The caller can retry without the UDI if appropriate.

@xingbowang
Copy link

In the read path, we continue to return error since the user explicitly requested the UDI. The caller can retry without the UDI if appropriate.

Sounds good. As long as we have test to cover this.

@facebook-github-bot
Copy link
Contributor

@anand1976 has imported this pull request. If you are a Meta employee, you can view this in D81826054.

@facebook-github-bot
Copy link
Contributor

@anand1976 has imported this pull request. If you are a Meta employee, you can view this in D81826054.

@facebook-github-bot
Copy link
Contributor

@anand1976 merged this pull request in 0044a76.

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.

4 participants