Skip to content

rgw/s3vector: add session admin api, config options for stats and periodic eviction of inactive sessions - #70311

Closed
9401adarsh wants to merge 23 commits into
ceph:wip-s3vectorfrom
9401adarsh:wip-s3vector-session-admin
Closed

9401adarsh wants to merge 23 commits into
ceph:wip-s3vectorfrom
9401adarsh:wip-s3vector-session-admin

Conversation

@9401adarsh

Copy link
Copy Markdown
Contributor

rgw/s3vector: finish follow-up tasks listed in #68731 (comment).

Changes

  • Add rgw_s3vector_session_index_cache_size and
    rgw_s3vector_session_metadata_cache_size configuration options.
  • Add /admin/vectorbucket session operations:
    • GET ...?vectorbucket=<bucket>&session=true returns whether that
      vector bucket has an active session, plus its index and metadata cache statistics.
    • GET ...?uid=<user>&session=true lists active vector-bucket sessions
      owned by the specified user, with pagination support.
    • DELETE ...?vectorbucket=<bucket>&session=true removes that vector
      bucket’s active session; succeeds even if no session is currently active.
  • Require RGW buckets capabilities for session admin operations.
  • Add rgw_s3vector_session_inactive_timeout; inactive sessions are removed by the
    background manager after the configured timeout.
  • Keep concurrent session lookups through the shared mutex while atomically recording
    session activity.
  • Add coverage for session admin operations and inactivity eviction.

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 x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

yuvalif and others added 23 commits July 15, 2026 15:03
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]>
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]>
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]>
* 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]>
…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]>
@ceph-jenkins

Copy link
Copy Markdown
Collaborator

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
@ceph-jenkins

Copy link
Copy Markdown
Collaborator

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.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

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.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

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.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

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.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

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.

@ceph-jenkins

Copy link
Copy Markdown
Collaborator

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.

@9401adarsh

Copy link
Copy Markdown
Contributor Author

@yuvalif - please have a look and let me know your thoughts.

@9401adarsh
9401adarsh marked this pull request as ready for review July 19, 2026 07:49
@9401adarsh
9401adarsh requested a review from a team as a code owner July 19, 2026 07:49
Copilot AI review requested due to automatic review settings July 19, 2026 07:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@9401adarsh
9401adarsh requested a review from Copilot July 20, 2026 04:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@yuvalif
yuvalif requested a review from a team as a code owner July 20, 2026 13:24
@yuvalif
yuvalif force-pushed the wip-s3vector branch 2 times, most recently from d6feb28 to 96018c5 Compare July 20, 2026 15:17
return bucket.set_quota(op_state, dpp, y);
}

namespace {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 -*-

@yuvalif yuvalif Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is not rados sepcific. please move this file out of the rados driver
also, please rename to rgw_rest_vectorbucket.cc

Comment thread src/rgw/rgw_s3vector_background.cc Resolved
ldpp_dout(this, 1) << "ERROR: failed to get index cache stats for bucket "
<< bucket_name << ": " << error_message << dendl;
}
if (error_message) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why do you check that twice?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will remove it.


using namespace std;

namespace {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why do you need the anonymus namespace?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we use the "buckets" capability or add a new one?

&existed);
}

int require_true_bool(req_state* s, const std::string& name)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 {

@yuvalif yuvalif Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

where is this flag used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why do we need the bucket object in the struct?
is is passed from REST to the undelying code?

@9401adarsh

Copy link
Copy Markdown
Contributor Author

closing this PR, refer new one here: #70553

@9401adarsh 9401adarsh closed this Jul 27, 2026
@9401adarsh
9401adarsh deleted the wip-s3vector-session-admin branch August 25, 2026 23:24
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