Repository navigation
rgw/s3vector: add session admin api, config options for stats and periodic eviction of inactive sessions - #70311
9401adarsh wants to merge 23 commits into
Conversation
do some fixes to message validation based on the tesst Signed-off-by: Yuval Lifshitz <[email protected]>
Signed-off-by: Yuval Lifshitz <[email protected]>
Signed-off-by: Yuval Lifshitz <[email protected]>
Signed-off-by: Yuval Lifshitz <[email protected]>
not implemented in this commit: * caching information as VectorBucket attributes and fetching them from there: schema, distance type * VectorBucket policy APIs * metadata support Signed-off-by: Yuval Lifshitz <[email protected]>
also fix shaman build failures with lancedb-c. see: https://shaman.ceph.com/builds/ceph/wip-add-lancedb/e7ce95d8e2e279b373f3c486bd1f64c39b23883f/ note that currently we are testing only against centos since the rust version in ubuntu jammy and noble is too old for lancedb liblancedb.so is installed as part of the ceph_base Signed-off-by: Yuval Lifshitz <[email protected]>
use non-system user. similar to fix here: 8935c1f Signed-off-by: Yuval Lifshitz <[email protected]>
Signed-off-by: Yuval Lifshitz <[email protected]>
Signed-off-by: Yuval Lifshitz <[email protected]>
also. fix token waited issue Signed-off-by: Yuval Lifshitz <[email protected]>
see: lancedb/lancedb-c#45 also run test on rpm latest (rocky10) Signed-off-by: Yuval Lifshitz <[email protected]>
* wait for longer than sleep idle time for graceful shutdown * empty queue on shutdown * avoud double join on non-graceful shutdown Signed-off-by: Yuval Lifshitz <[email protected]>
Signed-off-by: Yuval Lifshitz <[email protected]>
* session is created on vector bucket creation or if any vector level operation is performed and no session for the relevent vector bucket exists * session creation is async and best effors. if operation is done when a session does not exists, it should not fail the operation, but the operation will not benefit for the cahced index and metadata * session is deleted when vector bucket is deleted, or when another operation failed with -ENOENT on the vector bucket (probably deleted by another RGW or concurrently by another request on the same RGW) Signed-off-by: Adarsh <[email protected]>
* we support `nonFilterableMetadataKeys` and reject filter that include
any of the fields i nthat object
* we support the `filterableMetadataKeys` spec extension
* these fieldscould be used together with the nearest neighbour search. for
performence and more accurate results
* this is done via dynamic creation of the lancedb table schema
* filterable metadata keys must not start with underscore.
this should allow future fixed schema columns to be added without name collision
* `mustExist` flag is used to fail put vector requests that are missing required fields
in case of filterable columns
* metadata field names with dots are rejected:
* dots are not allowed in lancedb column names
* we reject from all metadata fields to allow support
on nested field filtering in the future. we will use dot
notations for the path of the field, and this will be ambiguous
if we allow for dots in field names
* metadata fields support list type.
***Note*** filtering on list types is not supported here.
* PutVectors error handling:
* we verify that json metadata is valid, even for fields that are
in the dynamic schema
* reply with fieldList with approproate error message
* perform schema validation if filterable metadata keys are provided
* note that we dont error on fields not in the schema, just
on type mismatch for fields in the schema
* in case of batch update, do not continue processing in case of error
* if multiple errors are detected in the same row, stop on the first
* CreateIndex error handling:
* dont allow for index creation on an existing index even if they are
the same
* let lancedb detect any schema violation on filterable columns
* check there is no overlap between filterable and non filterable
* QueryFilter implementation:
* filters on filterablekeys and on the metadata json columns
* filter of both types are not allowed with an OR operator (allowed
for with AND operator)
* filtering is not allowed on array typed data
* filters on keys filterablekeys is done inside lancedb
* filtering on other keys is done after we get the results from lancedb
against the json metadata column. in such a case we may return less
results than asked
* non-filterable keys are used only to reject filters
* we have post-filter topk factor conf option. when post filtering is used
we allow to oversample so that after filtering we may still have k results.
if after filtering we have more than k results, we truncate the reply to k.
* added a flag to force post-filtering for mixed OR queries.
in case tha the query uses an OR condition between JSON metadata fileds
and a metadata column we return an error. to still allow that the
usercan set a flag to treat all fileds as JSON, even if they exist in the table
* json null values are currently rejected:
* no support in the expr api of lancedb-c
* for filterable columns that allow nulls, it is not possible
to distinguish null value from missing field
Signed-off-by: Yuval Lifshitz <[email protected]>
Reviewed-by: Gal Salomon <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: Yuval Lifshitz <[email protected]>
Signed-off-by: Yuval Lifshitz <[email protected]>
Signed-off-by: Yuval Lifshitz <[email protected]>
Signed-off-by: Adarsh <[email protected]>
Signed-off-by: Adarsh <[email protected]>
…d within last x seconds, x is set as a config value Signed-off-by: Adarsh <[email protected]>
Signed-off-by: Adarsh <[email protected]> rgw/s3vector: add test for session inactivity Signed-off-by: Adarsh <[email protected]>
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
6 similar comments
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
Thank you for your contribution. Since you, the author, are not a member of the Ceph GitHub Org yet, our CI will not automatically run. Any member of the Ceph Org may comment "ok - to - test" (without the dashes) to allow the Jenkins jobs to run. |
|
@yuvalif - please have a look and let me know your thoughts. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
d6feb28 to
96018c5
Compare
| return bucket.set_quota(op_state, dpp, y); | ||
| } | ||
|
|
||
| namespace { |
There was a problem hiding this comment.
does not looks like this is rados specific code. please move out of the driver/rados directory. this code can be in rgw_s3vector.cc or in a new file rgw_s3vector_stats.cc
| @@ -0,0 +1,34 @@ | |||
| // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*- | |||
There was a problem hiding this comment.
this is not rados sepcific. please move this file out of the rados driver
also, please rename to rgw_rest_vectorbucket.cc
| ldpp_dout(this, 1) << "ERROR: failed to get index cache stats for bucket " | ||
| << bucket_name << ": " << error_message << dendl; | ||
| } | ||
| if (error_message) { |
There was a problem hiding this comment.
why do you check that twice?
|
|
||
| using namespace std; | ||
|
|
||
| namespace { |
There was a problem hiding this comment.
why do you need the anonymus namespace?
There was a problem hiding this comment.
not needed, removed in the new PR.
| class RGWOp_VectorBucket_Session_Info : public RGWRESTOp { | ||
| public: | ||
| int check_caps(const RGWUserCaps& caps) override { | ||
| return caps.check_cap("buckets", RGW_CAP_READ); |
There was a problem hiding this comment.
should we use the "buckets" capability or add a new one?
| &existed); | ||
| } | ||
|
|
||
| int require_true_bool(req_state* s, const std::string& name) |
There was a problem hiding this comment.
why is this wrapper useful?
| static int sync_bucket(rgw::sal::Driver* driver, RGWBucketAdminOpState& op_state, const DoutPrefixProvider *dpp, optional_yield y, std::string *err_msg = NULL); | ||
| }; | ||
|
|
||
| struct RGWVectorBucketAdminOpState { |
There was a problem hiding this comment.
if this is a simple struct why do you need all the setters and getters?
could you make all data members of the struct const.
initialize it in one place and just pass it in to the functions thta needs this data?
| rgw::sal::VectorBucket* get_bucket() { return bucket.get(); } | ||
| }; | ||
|
|
||
| class RGWVectorBucketAdminOp { |
There was a problem hiding this comment.
why do we ned a calss with only static member functions?
| return -EINVAL; | ||
| } | ||
|
|
||
| int ret = vector_bucket_admin::load_vector_bucket_admin(driver, op_state, |
There was a problem hiding this comment.
why do we need to load the session before deletion?
| std::string bucket_name; | ||
| std::string marker; | ||
| uint32_t max_entries{1000}; | ||
| bool fetch_session{false}; |
There was a problem hiding this comment.
not needed, removed this in the new PR.
| std::string marker; | ||
| uint32_t max_entries{1000}; | ||
| bool fetch_session{false}; | ||
| std::unique_ptr<rgw::sal::VectorBucket> bucket; |
There was a problem hiding this comment.
why do we need the bucket object in the struct?
is is passed from REST to the undelying code?
|
closing this PR, refer new one here: #70553 |
rgw/s3vector: finish follow-up tasks listed in #68731 (comment).
Changes
rgw_s3vector_session_index_cache_sizeandrgw_s3vector_session_metadata_cache_sizeconfiguration options./admin/vectorbucketsession operations:GET ...?vectorbucket=<bucket>&session=truereturns whether thatvector bucket has an active session, plus its index and metadata cache statistics.
GET ...?uid=<user>&session=truelists active vector-bucket sessionsowned by the specified user, with pagination support.
DELETE ...?vectorbucket=<bucket>&session=trueremoves that vectorbucket’s active session; succeeds even if no session is currently active.
bucketscapabilities for session admin operations.rgw_s3vector_session_inactive_timeout; inactive sessions are removed by thebackground manager after the configured timeout.
session activity.
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.