Closed 0ctopus13prime closed 3 months ago
@0ctopus13prime please fix the conflicts. and DCO check.
Will discard this PR and let me re-raise a new PR that prohibits all disallowed characters for any vector fields.
Raised a new PR to block invalid characters for a physical file name entirely
Description
Issue : https://github.com/opensearch-project/k-NN/issues/1859.
Issue
While OpenSearch does allow for a field name to have an empty space within it and it disallows an empty space to be contained in a physical file name, KNNCodecUtil::buildEngineFileName uses the field name as a part of a vector file name directly without any proper adjustment to be made. As a result, if the field name does not meet the valid criteria, it can fail due to failing the validation in BlobStoreIndexShardSnapshot. For example, _0_2011_my vector.hnswc ('my vector' is the field name). As a result, BlobStoreIndexShardSnapshot throws an exception complaining file name is not valid.
Solution
In KNNCodecUtil, we need to add a method to escape invalid characters in the field name when creating file name. In this solution proposal, I'm suggesting to escape it to '.'. For example,
_0_2011_my vector.hnswc
β_0_2011_my.vector.hnswc
.Field name does not have "." inside, as it indicates more than one field name if the dot presents. For example,
a.b.c
indicates three fields witha
,b
andc
.AS-IS:
TO-BE:
Related Issues
Issue : https://github.com/opensearch-project/k-NN/issues/1859.
Check List
--signoff
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.