Repository navigation
feat: SearchVectors inequality filters #1449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
105 commits
Select commit
Hold shift + click to select a range
260bd5b
feat(storage): let a vector search carry an item filter
mdeepth fb47454
feat(core): parse the extended SearchConditionExpression grammar
mdeepth 6506ece
feat(engine): serve the extended search grammar to enabled accounts
mdeepth a3402e2
test(storage): run the extended search grammar on SQLite and PostgreSQL
mdeepth e1b10cf
test: cover SearchVectors inequality filters over the wire
mdeepth 3e26169
fix(engine): check the SearchVectors expression maps as the service does
mdeepth 2336a97
fix(core): compare SearchVectors inline filter numbers as binary64
mdeepth cd5d7cf
test(search): pin the expression maps, binary64 numbers, both grammars
mdeepth 1ea4a1d
test(engine): cover the SearchVectors projection and unused-name wiring
mdeepth 8f98069
test(core): pin exact number comparison in condition expressions
mdeepth 3c15323
fix(core): parse and check search conditions without recursion
mdeepth 9974769
fix(core): reject a search condition name that starts with an underscore
mdeepth 7322ed5
fix(core): accept a parenthesised operand in a search condition
mdeepth 30488c7
fix(core): check search condition function operands by type
mdeepth 856a314
test(core): pin the exact BETWEEN bound check of the search grammar
mdeepth 87b9c2c
refactor(engine): move the search condition dispatch into its own module
mdeepth f78cd31
fix(engine): read the search filter setting per server, cached, bounded
mdeepth 2787d20
fix(engine): keep equality-only search conditions as equality pairs
mdeepth a066209
test(engine): pin the search map checks ahead of table and vector checks
mdeepth 3ca3985
fix(storage-postgres): read a filtered vector search in bounded pages
mdeepth 245bca8
test(storage-postgres): pin the paged filtered vector search
mdeepth 0ff1440
test(search): read the grammar setting instead of writing it
mdeepth cc2850a
ci: build, lint and test the search-inequality-filters feature
mdeepth 81967c4
fix(storage-postgres): cancel an abandoned search in its own transaction
mdeepth 65f496a
fix(engine): send one read of the search filter setting at a time
mdeepth aac73cb
fix(storage-postgres): bound a settings read on the server
mdeepth e0da15b
test(engine): read the search filter setting through poisoned locks
mdeepth e4d2674
test(search): pin the exact BETWEEN bound check on the wire
mdeepth a866bee
test(search): pin the empty map answer ahead of a missing table
mdeepth 44d2d89
test(search): send deeply nested search conditions on the wire
mdeepth 734e7af
test(search): date the search condition measurements
mdeepth efae1b7
feat(engine): serve the extended search grammar by default
mdeepth b65c23f
docs(search): describe the extended grammar as the service serves it
mdeepth c477e00
test(server): pin SearchVectors dynamodb:Attributes and names map checks
LeeroyHannigan 501ff42
docs(upgrade): record the SearchVectors grammar and map checks of 1.1.0
mdeepth 120d0b1
test(search): pin a bad name ahead of a bad key in the names map
mdeepth e9f5747
refactor(engine): move the SearchVectors request checks to a module
mdeepth fda5e7d
fix(engine): use the last read search filter setting through a fault
mdeepth 474a8a1
fix(engine): enable no account for a malformed search filter setting
mdeepth aa9d69e
fix(app): show the default of the search filter setting
mdeepth c3320b2
fix(engine): skip the search filter setting when both grammars agree
mdeepth 95c32f4
fix(server): set no dynamodb:Attributes value on SearchVectors
mdeepth a2196c6
fix(server): check a SearchVectors request before the policy decision
mdeepth b3f7f54
ci: build and wire-test the search grammar compiled out
mdeepth 514105a
docs(search): correct the condition count and describe setting reads
mdeepth f73cad8
test(core): pin a too-large attribute name ahead of a bad names key
mdeepth 00aeea2
Merge main into feat/search-inequality-filters
mdeepth 37ae360
refactor(core): check SearchVectors map keys with the shared key check
mdeepth 054ae77
fix(core): share the BETWEEN bound check and show Binary bounds in ba…
mdeepth 81af51b
refactor(core): list unused SearchVectors map keys with one function
mdeepth 4ea1ca3
fix(core): read the SearchVectors size limits from the limits keys
mdeepth 2c1a9d0
test(core): pin the combined size of a search condition at one mebibyte
mdeepth 5be9fca
test(search): pin the doubled name marker and the combined size limit
mdeepth fa19720
perf(core): size each search condition substitution once
mdeepth 3d8339f
refactor(core): drop the table owner from the search filter setting
mdeepth 646579d
refactor(core): keep the parsed search conditions inside the grammar
mdeepth 0f9943e
refactor(core): define each search schema message once for both grammars
mdeepth 32fa112
docs(core): state what reaches a vector search backend and what recurses
mdeepth 888f75d
fix(auth): match a bare negated operator on SearchVectors attributes
mdeepth 144b338
test(server): name what the deny(null) order rows rest on
mdeepth e017fba
docs(search): state the check order served and where the grammar was …
mdeepth 06dcace
fix(wasm): serve the extended search grammar in the browser build
mdeepth 2604245
fix(devtools): edit no manifest when the compile-out count is wrong
mdeepth fc8dbf8
ci: check the search grammar feature state of the browser build
mdeepth 896f02c
ci: run the vector wire tests with the search setting as an account list
mdeepth 8d5d7c2
test(wasm): run the search grammar corpus cases only with the grammar
mdeepth 55da96d
docs(adr): record the search condition grammar, its seam and its gate
mdeepth 096ba91
test(engine): build the unit test engine and context in one place
mdeepth 462aa71
refactor(engine): drop the unused vector search argument of the parse
mdeepth 8d69380
test(engine): move the poisoned lock and log tests of the setting
mdeepth f88a7d6
fix(engine): send one read of the search filter setting through a change
mdeepth 39c58e1
test(engine): poison the last value lock of the search filter setting
mdeepth 350a0af
fix(storage): bound only the SearchVectors read of a setting
mdeepth 117f63c
fix(engine): send the attribute a parenthesised equality names
mdeepth e850461
test(core): pin the function and bound messages of a search condition
mdeepth 464f7c4
refactor(core): keep the number precision of the evaluator in the crate
mdeepth 23bceb9
docs(core): state how the service and the FilterExpression parser rea…
mdeepth d9f8aa2
docs(engine): name the ServiceUnavailable wire type in the setting co…
mdeepth fd1c06b
fix(engine): wait on a read of the search filter setting only once
mdeepth 62627a8
test(engine): pin the one and two seconds of the search filter setting
mdeepth e4068ef
test(server): pin that a change of the search filter setting applies …
mdeepth 35f89c8
refactor(storage-postgres): move the bounded setting read to its own …
mdeepth ee5c63a
fix(storage-postgres): leave a caller's transaction open in a bounded…
mdeepth f160978
test(storage-postgres): read the session state of the transaction tes…
mdeepth 3f8bc6b
test(storage-postgres): fail the vector search tests without a server…
mdeepth 4cce288
docs(storage-postgres): state what the cancel check of a dropped vect…
mdeepth eb8564d
fix(build): turn the engine's search grammar off with the server's fe…
mdeepth cc39a31
fix(devtools): check the browser build's feature state for wasm32 too
mdeepth f1f902f
docs(devtools): state what run-tests does with the search setting uns…
mdeepth 3abd4be
perf(search): check a SearchVectors request once
mdeepth e0de13e
fix(server): record the latency segments of a SearchVectors that fail…
mdeepth 242a587
docs(storage): state where each backend applies the search item filter
mdeepth d508647
docs(search): list every SearchVectors answer the grammar change moves
mdeepth a56efa8
test(server): read the SearchVectors segments of a new account when i…
mdeepth df895be
docs(adr): number the search condition grammar decision 0031
mdeepth bc19a59
docs(upgrade): list the unused-name answer to a parenthesised name
mdeepth 7e6c4b2
Merge main into feat/search-inequality-filters
mdeepth d1b8b31
fix(server): record a failed SearchVectors check into the bucketed se…
mdeepth 85cca82
test(core): count a substituted name at each of its uses in the searc…
mdeepth a3a9533
fix(core): saturate the combined size of a search condition
mdeepth 1316c01
docs(core): drop a stray line from the between_bounds_fault comment
mdeepth 148d209
test(engine): run the per-use size row only with the extended grammar
mdeepth 511389f
Merge main into feat/search-inequality-filters
mdeepth 2a57abc
Merge main into feat/search-inequality-filters
mdeepth 8620a60
fix(storage-postgres): pass the filtered search SQL to sqlx 0.9 in As…
mdeepth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,168 @@ | ||
| name: Search inequality filters | ||
| on: | ||
| pull_request: | ||
| merge_group: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| # Same grouping as the other workflows: a new push to a pull request | ||
| # supersedes its in-flight run, and every other run has a group of its own. | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| # The search-inequality-filters Cargo feature is on by default, so the other | ||
| # workflows build, lint and test it, and their wire tests run with the | ||
| # search_inequality_filters setting absent, which gives every account the | ||
| # extended grammar. These jobs cover what they do not: the workspace built, | ||
| # linted and tested with the feature compiled out, the feature state of the | ||
| # browser build, and the vector wire tests with the setting written as `off` | ||
| # and as a list of accounts, and against the build with the feature compiled | ||
| # out. | ||
| # | ||
| # The storage crates and core are taken with their default features, so no | ||
| # cargo command line compiles the feature out. The workspace takes | ||
| # extenddb-engine and extenddb-server with their default features off: the | ||
| # server's feature turns on the engine's, the app's turns on the server's, | ||
| # and extenddb-wasm-adapter, the browser build, names the feature for the | ||
| # engine, core and the SQLite backend itself. devtools/compile-out-search-inequality-filters removes the | ||
| # feature from the default list of every crate that declares it, which | ||
| # compiles it out of the workspace, and checks that nothing enables it; with | ||
| # `--check on` it checks that the browser build enables it on all three. | ||
| jobs: | ||
| compiled-out: | ||
| runs-on: extenddb_ubuntu-2404_4-core | ||
| timeout-minutes: 40 | ||
| steps: | ||
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | ||
| - uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master | ||
| with: | ||
| toolchain: 1.97.0 | ||
| components: clippy | ||
| - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 | ||
| with: | ||
| save-if: ${{ github.ref == 'refs/heads/main' }} | ||
| - name: Check that the browser build enables the feature on the engine, core and SQLite | ||
| run: devtools/compile-out-search-inequality-filters --check on | ||
| - name: Compile the feature out | ||
| run: devtools/compile-out-search-inequality-filters | ||
| - name: Lint the workspace with the feature compiled out | ||
| run: cargo clippy --locked --workspace --all-targets -- -D warnings | ||
| - name: Unit tests with the feature compiled out | ||
| run: | | ||
| cargo test --locked --no-fail-fast -p extenddb-core -p extenddb-engine \ | ||
| -p extenddb-server -p extenddb-app --lib | ||
|
|
||
| wire: | ||
| runs-on: extenddb_ubuntu-2404_4-core | ||
| timeout-minutes: 60 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| backend: [sqlite, postgres] | ||
| # `listed` writes the setting as the test account, which | ||
| # devtools/provision-test-credentials creates, and an account the | ||
| # tests do not use, so the tests expect the extended grammar from the | ||
| # list. The absent setting, which gives every account the grammar, is | ||
| # what integration.yml runs. | ||
| setting: ["off", listed, compiled-out] | ||
| services: | ||
| postgres: | ||
| image: pgvector/pgvector:pg16 | ||
| env: | ||
| POSTGRES_PASSWORD: devpass | ||
| options: >- | ||
| --health-cmd "pg_isready -U postgres" | ||
| --health-interval 5s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
| ports: | ||
| - 127.0.0.1:5432:5432 | ||
| steps: | ||
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0 | ||
| - uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master | ||
| with: | ||
| toolchain: stable | ||
| - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 | ||
| with: | ||
| cache-on-failure: true | ||
| save-if: ${{ github.ref == 'refs/heads/main' }} | ||
|
|
||
| - name: Compile the feature out | ||
| if: matrix.setting == 'compiled-out' | ||
| run: devtools/compile-out-search-inequality-filters | ||
|
|
||
| - name: Build release | ||
| run: cargo build --locked --release -p extenddb --no-default-features --features ${{ matrix.backend }} | ||
|
|
||
| - name: Initialize ExtendDB | ||
| id: init | ||
| run: | | ||
| if [ "${{ matrix.backend }}" = sqlite ]; then | ||
| output=$(./target/release/extenddb init --backend sqlite --config extenddb.toml 2>&1) | ||
| else | ||
| output=$(./target/release/extenddb init --config extenddb.toml \ | ||
| --pg-host 127.0.0.1 --pg-port 5432 --pg-user postgres --pg-pass devpass 2>&1) | ||
| fi | ||
| echo "$output" | ||
| password=$(echo "$output" | grep -oP 'Password: \K\S+') | ||
| echo "admin_password=$password" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Start ExtendDB | ||
| run: | | ||
| # --write-pid-file so devtools/run-tests can restart the server with | ||
| # 'extenddb stop' when it needs to apply a config change. | ||
| ./target/release/extenddb serve --config extenddb.toml --foreground --write-pid-file & | ||
| for _ in $(seq 1 30); do | ||
| if curl -sfk https://127.0.0.1:18443/health > /dev/null; then | ||
| echo "Server ready" | ||
| exit 0 | ||
| fi | ||
| sleep 1 | ||
| done | ||
| echo "Server failed to start" | ||
| exit 1 | ||
|
|
||
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: Install Python dependencies | ||
| run: pip install -r requirements.txt | ||
|
|
||
| # Every wire test with "vector" in its file or test name, in parallel by | ||
| # file, except the CLI catalog migration file, which builds catalogs of | ||
| # its own and does not depend on the feature. devtools/run-tests writes | ||
| # the setting before the suite starts; the modules read it and fail when | ||
| # the server serves the other grammar. Under `listed` they expect the | ||
| # extended grammar, because the list names the test account. Under | ||
| # `off`, and against the build with the feature compiled out, which has | ||
| # no such setting, the tests of the extended grammar skip. | ||
| - name: Run the vector wire tests | ||
| env: | ||
| EXTENDDB_TEST_ENDPOINT: https://127.0.0.1:18443 | ||
| EXTENDDB_ADMIN_USER: admin | ||
| EXTENDDB_ADMIN_PASSWORD: ${{ steps.init.outputs.admin_password }} | ||
| EXTENDDB_TEST_BACKUP_STORE: ${{ matrix.backend == 'sqlite' && 'filesystem' || 'none' }} | ||
| EXTENDDB_TEST_SEARCH_INEQUALITY_FILTERS: ${{ matrix.setting == 'listed' && '123456789012,210987654321' || matrix.setting != 'compiled-out' && matrix.setting || '' }} | ||
| EXTENDDB_EXPECT_VECTORS: "1" | ||
| run: devtools/run-tests --extenddb --pytest --parallel --filter "vector and not test_cli" | ||
|
|
||
| - name: Dump server syslog on failure | ||
| if: failure() | ||
| run: sudo journalctl -t extenddb --no-pager -n 500 || true | ||
|
|
||
| search-inequality-filters: | ||
| runs-on: extenddb_ubuntu-2404_4-core | ||
| timeout-minutes: 5 | ||
| needs: [compiled-out, wire] | ||
| if: always() | ||
| steps: | ||
| - run: | | ||
| if [ "${{ needs.compiled-out.result }}" != "success" ] \ | ||
| || [ "${{ needs.wire.result }}" != "success" ]; then | ||
| exit 1 | ||
| fi | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This job is not among the checks main requires:
test,fmt,clippy,integration,mongodb-integration,notices-currentandcassandra-integration. The wire tests underoffand every test of the compiled-out build run only in this workflow, so a later PR can break either and merge green.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. The
search-inequality-filterssummary check needs to be added to the required checks of main; that is a repository setting, not something this PR can change.