Skip to content

doc/test/rgw/s3vectors: add session management and admin APIs - #72014

Open
yuvalif wants to merge 1 commit into
ceph:mainfrom
yuvalif:wip-s3vector-session-followup2
Open

yuvalif wants to merge 1 commit into
ceph:mainfrom
yuvalif:wip-s3vector-session-followup2

Conversation

@yuvalif

@yuvalif yuvalif commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

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.

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Config Diff Tool Output

+ added: rgw_s3vector_session_index_cache_size (rgw.yaml.in)
+ added: rgw_s3vector_session_metadata_cache_size (rgw.yaml.in)
+ added: rgw_s3vector_session_inactive_timeout (rgw.yaml.in)

The above configuration changes are found in the PR. Please update the relevant release documentation if necessary.
Ignore this comment if docs are already updated. To make the "Check ceph config changes" CI check pass, please comment /config check ok and re-run the test.

@yuvalif yuvalif changed the title dox/test/rgw/s3vectors: add session management and admin APIs doc/test/rgw/s3vectors: add session management and admin APIs Sep 23, 2026
@yuvalif

yuvalif commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

@9401adarsh this is a rebase of your original PR (with some fixes and docs)

@yuvalif

yuvalif commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

/config check ok

@yuvalif

yuvalif commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

@galsalomon66 could you please review. this PR touches areas that has overlap with your background PR:

  • background process
  • admin APIs

@yuvalif

yuvalif commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@yuvalif

yuvalif commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test api

@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

Comment thread src/rgw/rgw_s3vector_background.cc Resolved
@yuvalif
yuvalif force-pushed the wip-s3vector-session-followup2 branch from 9e33187 to f475dfb Compare October 15, 2026 04:20
@yuvalif
yuvalif requested a review from 9401adarsh October 15, 2026 04:21
@yuvalif
yuvalif force-pushed the wip-s3vector-session-followup2 branch from 3c309b6 to 434cd22 Compare October 15, 2026 13:42
@yuvalif

yuvalif commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

@yuvalif

yuvalif commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@yuvalif
yuvalif force-pushed the wip-s3vector-session-followup2 branch from 434cd22 to b21f34e Compare October 16, 2026 09:02
@yuvalif

yuvalif commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

rgw regression: https://pulpito-ng.ceph.com/runs/yuvalif-2026-10-15_14:15:35-rgw-wip-yuval-test-s3vectors-15-10-distro-default-trial

is failing on:

  • ragweed issue ailure_reason: Command failed on trial163 with status 128: 'git clone -b ceph-umbrella https://git.ceph.com/ragweed.git /home/ubuntu/cephtest/ragweed.client.0'
  • java maven issue: 2026-10-16T08:46:04.588 INFO:tasks.workunit.client.0.trial087.stderr:Exception in thread "main" java.io.IOException: Server returned HTTP response code: 429 for URL: https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
  • known lua failue (tracker exists)

@yuvalif

yuvalif commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

jenkins test api

@yuvalif

yuvalif commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

rerun: https://pulpito-ng.ceph.com/runs/yuvalif-2026-10-16_20:14:11-rgw-wip-yuval-test-s3vectors-15-10-distro-default-trial
all failures are with:

Exception in thread "main" java.io.IOException: Server returned HTTP response code: 429 for URL:
  https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip

e.g. https://pulpito-ng.ceph.com/runs/jenkins-build-2026-10-16_15:05:22-rgw-main-distro-default-trial

@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

@galsalomon66

Copy link
Copy Markdown
Contributor

upon many concurrent queries on many different indexes, each has its own index-cache, RGW may cause OOM
the rgw_s3vector_session_index_cache_size and rgw_s3vector_session_index_cache_size are limitation on session level, there is no global limitation that put restriction on total memory consumption.

with rgw_s3vector_session_inactive_timeout (currently set to 3600s , maybe its better to reduce that) we can enforce some kind of global limitation, but it is not enough.

sessions should remove upon memory consumption is crossing configurable threshold.
(the eviction policy could be base on cache-size and last-used)

the rgw_s3vector_session_index_cache_size should be with accordance , to max-bucket and available-memory-in-machine

@yuvalif

yuvalif commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor Author

upon many concurrent queries on many different indexes, each has its own index-cache, RGW may cause OOM the rgw_s3vector_session_index_cache_size and rgw_s3vector_session_index_cache_size are limitation on session level, there is no global limitation that put restriction on total memory consumption.

with rgw_s3vector_session_inactive_timeout (currently set to 3600s , maybe its better to reduce that) we can enforce some kind of global limitation, but it is not enough.

sessions should remove upon memory consumption is crossing configurable threshold. (the eviction policy could be base on cache-size and last-used)

the rgw_s3vector_session_index_cache_size should be with accordance , to max-bucket and available-memory-in-machine

that makes sense.
but to follow the way that other things are sized onthe RGW, i would suggest to add rgw_s3vectors_max_sessions.
this is less efficient - we would be limiting according to the wors case, but, in theory, maye still more space.
however, there is currently no session resize in lance, so, the only option is to limit based on the maximum capacity iof each session.

we might add session resize to lancedb in the future, since the underlying caching library does support it.
(see: lance-format/lance#10137) but this is a long term solution.

@galsalomon66

Copy link
Copy Markdown
Contributor

upon many concurrent queries on many different indexes, each has its own index-cache, RGW may cause OOM the rgw_s3vector_session_index_cache_size and rgw_s3vector_session_index_cache_size are limitation on session level, there is no global limitation that put restriction on total memory consumption.
with rgw_s3vector_session_inactive_timeout (currently set to 3600s , maybe its better to reduce that) we can enforce some kind of global limitation, but it is not enough.
sessions should remove upon memory consumption is crossing configurable threshold. (the eviction policy could be base on cache-size and last-used)
the rgw_s3vector_session_index_cache_size should be with accordance , to max-bucket and available-memory-in-machine

that makes sense. but to follow the way that other things are sized onthe RGW, i would suggest to add rgw_s3vectors_max_sessions. this is less efficient - we would be limiting according to the wors case, but, in theory, maye still more space. however, there is currently no session resize in lance, so, the only option is to limit based on the maximum capacity iof each session.

we might add session resize to lancedb in the future, since the underlying caching library does support it. (see: lance-format/lance#10137) but this is a long term solution.

the case of many indexes(100, 1000 ...) and many queries that "hit" and create session that last for an hour is quite possible, and may cause OOM.
the rgw_s3vector_session_index_cache_size is currently too big (6GB) , the total consumption may grow quite quickly with many-indexes/many-spread-queries, because the window time for session could be too big.

as immediate action the rgw_s3vector_session_inactive_timeout should reduce to minutes, and rgw_s3vector_session_index_cache_size to MB's.

in a later phase the background process can iterate the active sessions, calculate the total consumption, and avoid creating new session upon crossing a threshold. not a big change.

or remove-session according to policy (oldest,biggest).

with "intelligent" session-removal we can provide bigger cache size to session.

Comment thread src/rgw/CMakeLists.txt Outdated
rgw_bucket_sync.cc
rgw_rest_restore.cc)
rgw_rest_restore.cc
rgw_rest_s3vector.cc

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.

shouldn't these be added under "WITH_RADOSGW_LANCEDB"?

LanceDBSessionCacheStats metadata_cache_stats{};
bool session_active = false;

ret = get_index_cache_stats(dpp, op_state.bucket_ns, op_state.bucket_name,

@soumyakoduri soumyakoduri Oct 19, 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.

There are chances of having race here where in session could be deleted (and re-created) between these two stats call.

Instead can they be fetched in a single call get_cache_stats(.., <optional> index_stats_ptr, <optional> metadata_cache_stats_ptr..), where both can be read from single session found.

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.

these are 2 separate lancedb-c API calls:

lancedb_session_index_cache_stats()
lancedb_session_metadata_cache_stats()

which map 2 separate lancedb calls. to fix this, we we add the combined API at lancedb level:
https://docs.rs/lancedb/latest/lancedb/index.html?search=cache_stats

LanceDBSessionCacheStats index_cache_stats{};
LanceDBSessionCacheStats metadata_cache_stats{};

ret = get_index_cache_stats(dpp, op_state.bucket_ns, bucket.bucket.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.

same issue may arise here as well.

Comment thread src/rgw/rgw_vector_bucket_admin.cc Outdated
continue;
}
if (ret < 0) {
return ret;

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.

formatter->close_section() before returning?

@yuvalif
yuvalif force-pushed the wip-s3vector-session-followup2 branch from b21f34e to 1682429 Compare November 25, 2026 12:11
@yuvalif
yuvalif force-pushed the wip-s3vector-session-followup2 branch from 1682429 to 45b8539 Compare November 25, 2026 15:19

@anthonyeleven anthonyeleven 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.

doc suggestions

Comment thread doc/radosgw/s3vectors.rst Resolved
Comment thread src/common/options/rgw.yaml.in Resolved
Comment thread src/common/options/rgw.yaml.in Resolved
Comment thread src/common/options/rgw.yaml.in Resolved
Comment thread src/common/options/rgw.yaml.in Resolved
@github-actions

github-actions Bot commented Dec 2, 2026

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 force-pushed the wip-s3vector-session-followup2 branch from 45b8539 to b640966 Compare December 2, 2026 16:29
* configure vector bucket session cache sizes
* add periodic session eviction in the manager
  if session not used within last x seconds (set as a config value)
* add REST API support for session ops
  currently supported ops
* let list vectors use sessions
* add config option to disable sessions

Signed-off-by: Adarsh <[email protected]>
Co-authored-by: Yuval Lifshitz <[email protected]>
Assisted-by: claude-code:claude-fable-5-1
@yuvalif
yuvalif force-pushed the wip-s3vector-session-followup2 branch from b640966 to 634eada Compare December 2, 2026 17:03
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.

5 participants