-
Notifications
You must be signed in to change notification settings - Fork 55
Negation querying with schema level tracked/untracked keys #577
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
base: fulltext
Are you sure you want to change the base?
Conversation
* Revise Save/Restore for true pit snapshot. (valkey-io#401) * fix mem leak in unit test (valkey-io#492) Signed-off-by: Miles Song <bodasong@amazon.com> * Add support for checking ACL key prefix permissions using the new Valkey module API. (valkey-io#479) * Add support for checking ACL key prefix permissions in Valkey module This change introduces a new function `AclValkeyCheckPermissions` that leverages Valkey's native ACL infrastructure to verify user permissions for key prefixes. It uses the new `ValkeyModule_ACLCheckKeyPrefixPermissions` API when available, falling back to the legacy `Call(ACL,...)` approach for older Valkey versions. Additionally, the build script is updated to properly detect and use the configured build tool (make or ninja) for CMake integration. Updated `.clang-format` for `PointerAlignment: Right` (with `clang-format v21` pointer is aligned **LEFT** with Google's style). * ACL permission checking: Added fast-path permission validation using ValkeyModule_ACLCheckKeyPrefixPermissions * Build system: Improved build tool detection logic in build.sh * Managed pointers: Added UniqueValkeyModuleUser for automatic ValkeyModuleUser cleanup * Header reorganization: Fixed include paths in commands.h ** Generated by CodeLite. ** Signed-off-by: Eran Ifrah <eifrah@amazon.com> * Addressed PR comments. Signed-off-by: Eran Ifrah <eifrah@amazon.com> --------- Signed-off-by: Eran Ifrah <eifrah@amazon.com> * Fixed regression which broke Ninja builds OO (valkey-io#494) * Fixed regression which broke Ninja builds OO Signed-off-by: Eran Ifrah <eifrah@amazon.com> * Fix Missing OS Detection in determine_ninja Function The determine_ninja function was missing the os_name variable initialization, which is needed for the platform check. Added the local os_name assignment using uname -s to properly detect the operating system before checking for Darwin. Signed-off-by: Eran Ifrah <eifrah@amazon.com> --------- Signed-off-by: Eran Ifrah <eifrah@amazon.com> * Fix flaky save/restore test (valkey-io#495) * Implement queue wait time aware local node preference in fanout operations (valkey-io#428) * Implement queue wait time logic for local node preference in fanout operations - Add configurable low-utilization-threshold option (default 50ms) - Optimize fanout target selection to prefer local node when task wait time in queue is below threshold - Monitor both reader and writer thread pool queue wait time for utilization decisions - Maintain random selection fallback when local preference unavailable or system under high load - Extend integration tests to validate new fanout target selection behavior - Refactor thread pools to track configurable size of queue wait time samples for utilization calculation This optimization reduces network overhead and improves query latency by keeping operations local when the system has spare capacity. Signed-off-by: yulazariy <yulazari@amazon.com> * fix clang format Signed-off-by: yulazariy <yulazari@amazon.com> * Fix the low utilization to use the cluster map mechanism Signed-off-by: yulazariy <yulazari@amazon.com> * Move all prefer local node logic to fanout.cc. minor build fixes Signed-off-by: yulazariy <yulazari@amazon.com> * Fix formating Signed-off-by: yulazariy <yulazari@amazon.com> * Revert new timeout function Signed-off-by: yulazariy <yulazari@amazon.com> --------- Signed-off-by: yulazariy <yulazari@amazon.com> * Populate fingerprint and version to IndexSchema (valkey-io#480) * populate fingerprint and version to IndexSchema Signed-off-by: Miles Song <bodasong@amazon.com> * remove logs Signed-off-by: Miles Song <bodasong@amazon.com> * minor fix according to comments Signed-off-by: Miles Song <bodasong@amazon.com> * load rdb integration tests Signed-off-by: Miles Song <bodasong@amazon.com> * fix clang tidy Signed-off-by: Miles Song <bodasong@amazon.com> * clean protobuf; populate fingerprint/version in MetadataManager::OnLoadingEnd Signed-off-by: Miles Song <bodasong@amazon.com> * rebase Signed-off-by: Miles Song <bodasong@amazon.com> * fix integration/run.sh and disable full trace Signed-off-by: Miles Song <bodasong@amazon.com> * fix according to comments Signed-off-by: Miles Song <bodasong@amazon.com> * fix spellcheck Signed-off-by: Miles Song <bodasong@amazon.com> --------- Signed-off-by: Miles Song <bodasong@amazon.com> * Fix warnings and formatting (valkey-io#503) Signed-off-by: Allen Samuels <allenss@amazon.com> * Fix Override Specifier and Suppress MacOS Compiler Warning (valkey-io#496) Suppress the -Wdefaulted-function-deleted warning on Apple platforms to address compiler-specific diagnostics. Also apply minor formatting improvements to CMake configuration for better readability. * src/commands/ft_dropindex.cc * CMakeLists.txt ** Generated by CodeLite. ** Signed-off-by: Eran Ifrah <eifrah@amazon.com> Co-authored-by: Allen Samuels <allenss@amazon.com> * feat: set command info for ft.create (valkey-io#299) * feat: set command info for ft.create Signed-off-by: proost <jwalag87@gmail.com> * fix: add file Signed-off-by: proost <jwalag87@gmail.com> * fix: wrong command arg format Signed-off-by: proost <jwalag87@gmail.com> * test: remove print Signed-off-by: proost <jwalag87@gmail.com> * test: fix broken test Signed-off-by: proost <jwalag87@gmail.com> * fix: wrong sub args Signed-off-by: proost <jwalag87@gmail.com> * style: format Signed-off-by: proost <jwalag87@gmail.com> * style: follow lint Signed-off-by: proost <jwalag87@gmail.com> * style: follow lint Signed-off-by: proost <jwalag87@gmail.com> --------- Signed-off-by: proost <jwalag87@gmail.com> Signed-off-by: Allen Samuels <allenss@amazon.com> Co-authored-by: Allen Samuels <allenss@amazon.com> * FT.SEARCH partition and consistency controls (valkey-io#464) * allshards/someshards for ft.search Signed-off-by: Miles Song <bodasong@amazon.com> * ft.search partition tests Signed-off-by: Miles Song <bodasong@amazon.com> * ft.search partition and consistency controls Signed-off-by: Miles Song <bodasong@amazon.com> * fix ft.search partition controls test Signed-off-by: Miles Song <bodasong@amazon.com> * fix format Signed-off-by: Miles Song <bodasong@amazon.com> * add configurable PreferConsistentResults Signed-off-by: Miles Song <bodasong@amazon.com> * refactor duplicate code in server.cc Signed-off-by: Miles Song <bodasong@amazon.com> * rebase; populate fingerprint/version from IndexSchema Signed-off-by: Miles Song <bodasong@amazon.com> * remove optional in proto; always check index schema consistency Signed-off-by: Miles Song <bodasong@amazon.com> --------- Signed-off-by: Miles Song <bodasong@amazon.com> * FT.INFO partition and consistency controls (valkey-io#469) * move fingeprint version check to server.cc Signed-off-by: Miles Song <bodasong@amazon.com> * ft.info partition and consistency controls Signed-off-by: Miles Song <bodasong@amazon.com> * remove unused logs Signed-off-by: Miles Song <bodasong@amazon.com> * add lock for onresponse Signed-off-by: Miles Song <bodasong@amazon.com> * fix according to comments Signed-off-by: Miles Song <bodasong@amazon.com> * rebase from main; populate fingerprint/version from IndexSchema in server.cc Signed-off-by: Miles Song <bodasong@amazon.com> * fix fanout operations Signed-off-by: Miles Song <bodasong@amazon.com> * rebase; add slot consistency check in ft.info Signed-off-by: Miles Song <bodasong@amazon.com> * fix integration tests Signed-off-by: Miles Song <bodasong@amazon.com> --------- Signed-off-by: Miles Song <bodasong@amazon.com> * Limit and Nocontent support for non vector queries (valkey-io#522) * Limit and Nocontent support for non vector Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com> * use ReplyAvailNeighbors Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com> * Use ReplyAvailNeighbors Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com> * fmt Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com> * Add integ testing for non vector queries with LIMIT and NOCONTENT Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com> * include tests for CME Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com> * add limit Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com> --------- Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com> * Fix compatibility test for ft.search use-cases (not included yet). Add documentation * Fix test Signed-off-by: Allen Samuels <allenss@amazon.com> * Add documentation Signed-off-by: Allen Samuels <allenss@amazon.com> --------- Signed-off-by: Allen Samuels <allenss@amazon.com> * Full support for DB numbers other than zero in cluster mode. (valkey-io#410) * Initial IndexName encode/decode Signed-off-by: Allen Samuels <allenss@amazon.com> * working now Signed-off-by: Allen Samuels <allenss@amazon.com> * format Signed-off-by: Allen Samuels <allenss@amazon.com> * formatting, remove unneded logs Signed-off-by: Allen Samuels <allenss@amazon.com> * spelling Signed-off-by: Allen Samuels <allenss@amazon.com> * formatting Signed-off-by: Allen Samuels <allenss@amazon.com> * Update for aggregation Signed-off-by: Allen Samuels <allenss@amazon.com> * Rewrite per feedback, move encoding into metadata_manager Signed-off-by: Allen Samuels <allenss@amazon.com> * fix merge errors Signed-off-by: Allen Samuels <allenss@amazon.com> * Revise per-object Encoding Version Signed-off-by: Allen Samuels <allenss@amazon.com> * fix integration test Signed-off-by: Allen Samuels <allenss@amazon.com> * Enhance metadata tests Signed-off-by: Allen Samuels <allenss@amazon.com> * Update semantic versioning Signed-off-by: Allen Samuels <allenss@amazon.com> * Implement schema-level versioning Signed-off-by: Allen Samuels <allenss@amazon.com> * include omitted test file Signed-off-by: Allen Samuels <allenss@amazon.com> * fix valkey version post GA Signed-off-by: Allen Samuels <allenss@amazon.com> * remove old drop option Signed-off-by: Allen Samuels <allenss@amazon.com> * delete check Signed-off-by: Allen Samuels <allenss@amazon.com> * remerge Signed-off-by: Allen Samuels <allenss@amazon.com> * fix integration test Signed-off-by: Allen Samuels <allenss@amazon.com> * redo Signed-off-by: Allen Samuels <allenss@amazon.com> * more Signed-off-by: Allen Samuels <allenss@amazon.com> * better Signed-off-by: Allen Samuels <allenss@amazon.com> * more Signed-off-by: Allen Samuels <allenss@amazon.com> * Fixes for non-routable Signed-off-by: Allen Samuels <allenss@amazon.com> * fix unit tests Signed-off-by: Allen Samuels <allenss@amazon.com> * Fix last test mismatch Signed-off-by: Allen Samuels <allenss@amazon.com> * Introduce ObjName Signed-off-by: Allen Samuels <allenss@amazon.com> * Revert "feat: set command info for ft.create (valkey-io#299)" This reverts commit c50f841. Signed-off-by: Allen Samuels <allenss@amazon.com> * cleanup Signed-off-by: Allen Samuels <allenss@amazon.com> * Cleanup 1 Signed-off-by: Allen Samuels <allenss@amazon.com> * cleanup 2 Signed-off-by: Allen Samuels <allenss@amazon.com> * cleanup 3 Signed-off-by: Allen Samuels <allenss@amazon.com> --------- Signed-off-by: Allen Samuels <allenss@amazon.com> * Fix replica crash by using legacy ACL path during replication (valkey-io#510) * Fix replica crash by using legacy ACL path during replication Modify AclPrefixCheck to use the new fast ACL API only for real user clients. During replication context, fall back to the legacy ACL path which has proper safety checks and prevents segmentation fault in VM_GetModuleUserFromUserName. This approach: - Preserves fast ACL checking for real users when new API is available - Uses safe legacy path during replication/AOF/internal operations - Prevents crashes while maintaining performance benefits Fixes crash introduced in commit e9f277c when ACL checking was added. * DCO Remediation Commit for Elias Tamraz <tamrazelias@gmail.com> I, Elias Tamraz <tamrazelias@gmail.com>, hereby add my Signed-off-by to this commit: 0384de5 Address code review feedback: - Add early return for non-real users to avoid unnecessary work - Replace conditional check with assertion for better error handling Co-authored-by: yairgott Signed-off-by: Elias Tamraz <tamrazelias@gmail.com> --------- Signed-off-by: Elias Tamraz <tamrazelias@gmail.com> * use negate flag parser in ft.info parser (valkey-io#524) Signed-off-by: Miles Song <bodasong@amazon.com> * fix text index Signed-off-by: Miles Song <bodasong@amazon.com> * fix format Signed-off-by: Miles Song <bodasong@amazon.com> --------- Signed-off-by: Miles Song <bodasong@amazon.com> Signed-off-by: Eran Ifrah <eifrah@amazon.com> Signed-off-by: yulazariy <yulazari@amazon.com> Signed-off-by: Allen Samuels <allenss@amazon.com> Signed-off-by: proost <jwalag87@gmail.com> Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com> Signed-off-by: Elias Tamraz <tamrazelias@gmail.com> Co-authored-by: Allen Samuels <allenss@amazon.com> Co-authored-by: eifrah-aws <eifrah@amazon.com> Co-authored-by: yulazariy <yulazari@amazon.com> Co-authored-by: Hyeonho Kim <jwalag87@gmail.com> Co-authored-by: KarthikSubbarao <karthikrs2021@gmail.com> Co-authored-by: Elias Tamraz <51382208+eliastam@users.noreply.github.com> DCO Remediation Commit for Allen Samuels <allenss@amazon.com> I, Allen Samuels <allenss@amazon.com>, hereby add my Signed-off-by to this commit: c2c1e7b I, Allen Samuels <allenss@amazon.com>, hereby add my Signed-off-by to this commit: be8b236 Signed-off-by: Allen Samuels <allenss@amazon.com> Third-Party DCO Remediation Commit for eifrah-aws <eifrah@amazon.com> On behalf of eifrah-aws <eifrah@amazon.com>, I, Allen Samuels <allenss@amazon.com>, hereby add my Signed-off-by to this commit: e9f277c On behalf of eifrah-aws <eifrah@amazon.com>, I, Allen Samuels <allenss@amazon.com>, hereby add my Signed-off-by to this commit: cdfe0c4 On behalf of eifrah-aws <eifrah@amazon.com>, I, Allen Samuels <allenss@amazon.com>, hereby add my Signed-off-by to this commit: de64571 Signed-off-by: Allen Samuels <allenss@amazon.com> Third-Party DCO Remediation Commit for Elias Tamraz <51382208+eliastam@users.noreply.github.com> On behalf of Elias Tamraz <51382208+eliastam@users.noreply.github.com>, I, Allen Samuels <allenss@amazon.com>, hereby add my Signed-off-by to this commit: 990efa0 Signed-off-by: Allen Samuels <allenss@amazon.com> Third-Party DCO Remediation Commit for Hyeonho Kim <jwalag87@gmail.com> On behalf of Hyeonho Kim <jwalag87@gmail.com>, I, Allen Samuels <allenss@amazon.com>, hereby add my Signed-off-by to this commit: c50f841 Signed-off-by: Allen Samuels <allenss@amazon.com> Third-Party DCO Remediation Commit for KarthikSubbarao <karthikrs2021@gmail.com> On behalf of KarthikSubbarao <karthikrs2021@gmail.com>, I, Allen Samuels <allenss@amazon.com>, hereby add my Signed-off-by to this commit: 6706ea2 Signed-off-by: Allen Samuels <allenss@amazon.com> Third-Party DCO Remediation Commit for Miles Song <54991825+boda26@users.noreply.github.com> On behalf of Miles Song <54991825+boda26@users.noreply.github.com>, I, Allen Samuels <allenss@amazon.com>, hereby add my Signed-off-by to this commit: d90a358 On behalf of Miles Song <54991825+boda26@users.noreply.github.com>, I, Allen Samuels <allenss@amazon.com>, hereby add my Signed-off-by to this commit: 57e5dfd On behalf of Miles Song <54991825+boda26@users.noreply.github.com>, I, Allen Samuels <allenss@amazon.com>, hereby add my Signed-off-by to this commit: 0026dfc On behalf of Miles Song <54991825+boda26@users.noreply.github.com>, I, Allen Samuels <allenss@amazon.com>, hereby add my Signed-off-by to this commit: b81574a On behalf of Miles Song <54991825+boda26@users.noreply.github.com>, I, Allen Samuels <allenss@amazon.com>, hereby add my Signed-off-by to this commit: 31d37d9 Signed-off-by: Allen Samuels <allenss@amazon.com>
Pre-filter evaluation (valkey-io#505) --------- Signed-off-by: Manish Addanki <daddaman@amazon.com>
Signed-off-by: Brennan Cathcart <brennancathcart@gmail.com>
Signed-off-by: Brennan Cathcart <brennancathcart@gmail.com>
* Revise Save/Restore for true pit snapshot. (valkey-io#401) * fix mem leak in unit test (valkey-io#492) Signed-off-by: Miles Song <bodasong@amazon.com> * Add support for checking ACL key prefix permissions using the new Valkey module API. (valkey-io#479) * Add support for checking ACL key prefix permissions in Valkey module This change introduces a new function `AclValkeyCheckPermissions` that leverages Valkey's native ACL infrastructure to verify user permissions for key prefixes. It uses the new `ValkeyModule_ACLCheckKeyPrefixPermissions` API when available, falling back to the legacy `Call(ACL,...)` approach for older Valkey versions. Additionally, the build script is updated to properly detect and use the configured build tool (make or ninja) for CMake integration. Updated `.clang-format` for `PointerAlignment: Right` (with `clang-format v21` pointer is aligned **LEFT** with Google's style). * ACL permission checking: Added fast-path permission validation using ValkeyModule_ACLCheckKeyPrefixPermissions * Build system: Improved build tool detection logic in build.sh * Managed pointers: Added UniqueValkeyModuleUser for automatic ValkeyModuleUser cleanup * Header reorganization: Fixed include paths in commands.h ** Generated by CodeLite. ** Signed-off-by: Eran Ifrah <eifrah@amazon.com> * Addressed PR comments. Signed-off-by: Eran Ifrah <eifrah@amazon.com> --------- Signed-off-by: Eran Ifrah <eifrah@amazon.com> * Fixed regression which broke Ninja builds OO (valkey-io#494) * Fixed regression which broke Ninja builds OO Signed-off-by: Eran Ifrah <eifrah@amazon.com> * Fix Missing OS Detection in determine_ninja Function The determine_ninja function was missing the os_name variable initialization, which is needed for the platform check. Added the local os_name assignment using uname -s to properly detect the operating system before checking for Darwin. Signed-off-by: Eran Ifrah <eifrah@amazon.com> --------- Signed-off-by: Eran Ifrah <eifrah@amazon.com> * Fix flaky save/restore test (valkey-io#495) * Implement queue wait time aware local node preference in fanout operations (valkey-io#428) * Implement queue wait time logic for local node preference in fanout operations - Add configurable low-utilization-threshold option (default 50ms) - Optimize fanout target selection to prefer local node when task wait time in queue is below threshold - Monitor both reader and writer thread pool queue wait time for utilization decisions - Maintain random selection fallback when local preference unavailable or system under high load - Extend integration tests to validate new fanout target selection behavior - Refactor thread pools to track configurable size of queue wait time samples for utilization calculation This optimization reduces network overhead and improves query latency by keeping operations local when the system has spare capacity. Signed-off-by: yulazariy <yulazari@amazon.com> * fix clang format Signed-off-by: yulazariy <yulazari@amazon.com> * Fix the low utilization to use the cluster map mechanism Signed-off-by: yulazariy <yulazari@amazon.com> * Move all prefer local node logic to fanout.cc. minor build fixes Signed-off-by: yulazariy <yulazari@amazon.com> * Fix formating Signed-off-by: yulazariy <yulazari@amazon.com> * Revert new timeout function Signed-off-by: yulazariy <yulazari@amazon.com> --------- Signed-off-by: yulazariy <yulazari@amazon.com> * Populate fingerprint and version to IndexSchema (valkey-io#480) * populate fingerprint and version to IndexSchema Signed-off-by: Miles Song <bodasong@amazon.com> * remove logs Signed-off-by: Miles Song <bodasong@amazon.com> * minor fix according to comments Signed-off-by: Miles Song <bodasong@amazon.com> * load rdb integration tests Signed-off-by: Miles Song <bodasong@amazon.com> * fix clang tidy Signed-off-by: Miles Song <bodasong@amazon.com> * clean protobuf; populate fingerprint/version in MetadataManager::OnLoadingEnd Signed-off-by: Miles Song <bodasong@amazon.com> * rebase Signed-off-by: Miles Song <bodasong@amazon.com> * fix integration/run.sh and disable full trace Signed-off-by: Miles Song <bodasong@amazon.com> * fix according to comments Signed-off-by: Miles Song <bodasong@amazon.com> * fix spellcheck Signed-off-by: Miles Song <bodasong@amazon.com> --------- Signed-off-by: Miles Song <bodasong@amazon.com> * Fix warnings and formatting (valkey-io#503) Signed-off-by: Allen Samuels <allenss@amazon.com> * Fix Override Specifier and Suppress MacOS Compiler Warning (valkey-io#496) Suppress the -Wdefaulted-function-deleted warning on Apple platforms to address compiler-specific diagnostics. Also apply minor formatting improvements to CMake configuration for better readability. * src/commands/ft_dropindex.cc * CMakeLists.txt ** Generated by CodeLite. ** Signed-off-by: Eran Ifrah <eifrah@amazon.com> Co-authored-by: Allen Samuels <allenss@amazon.com> * feat: set command info for ft.create (valkey-io#299) * feat: set command info for ft.create Signed-off-by: proost <jwalag87@gmail.com> * fix: add file Signed-off-by: proost <jwalag87@gmail.com> * fix: wrong command arg format Signed-off-by: proost <jwalag87@gmail.com> * test: remove print Signed-off-by: proost <jwalag87@gmail.com> * test: fix broken test Signed-off-by: proost <jwalag87@gmail.com> * fix: wrong sub args Signed-off-by: proost <jwalag87@gmail.com> * style: format Signed-off-by: proost <jwalag87@gmail.com> * style: follow lint Signed-off-by: proost <jwalag87@gmail.com> * style: follow lint Signed-off-by: proost <jwalag87@gmail.com> --------- Signed-off-by: proost <jwalag87@gmail.com> Signed-off-by: Allen Samuels <allenss@amazon.com> Co-authored-by: Allen Samuels <allenss@amazon.com> * FT.SEARCH partition and consistency controls (valkey-io#464) * allshards/someshards for ft.search Signed-off-by: Miles Song <bodasong@amazon.com> * ft.search partition tests Signed-off-by: Miles Song <bodasong@amazon.com> * ft.search partition and consistency controls Signed-off-by: Miles Song <bodasong@amazon.com> * fix ft.search partition controls test Signed-off-by: Miles Song <bodasong@amazon.com> * fix format Signed-off-by: Miles Song <bodasong@amazon.com> * add configurable PreferConsistentResults Signed-off-by: Miles Song <bodasong@amazon.com> * refactor duplicate code in server.cc Signed-off-by: Miles Song <bodasong@amazon.com> * rebase; populate fingerprint/version from IndexSchema Signed-off-by: Miles Song <bodasong@amazon.com> * remove optional in proto; always check index schema consistency Signed-off-by: Miles Song <bodasong@amazon.com> --------- Signed-off-by: Miles Song <bodasong@amazon.com> * FT.INFO partition and consistency controls (valkey-io#469) * move fingeprint version check to server.cc Signed-off-by: Miles Song <bodasong@amazon.com> * ft.info partition and consistency controls Signed-off-by: Miles Song <bodasong@amazon.com> * remove unused logs Signed-off-by: Miles Song <bodasong@amazon.com> * add lock for onresponse Signed-off-by: Miles Song <bodasong@amazon.com> * fix according to comments Signed-off-by: Miles Song <bodasong@amazon.com> * rebase from main; populate fingerprint/version from IndexSchema in server.cc Signed-off-by: Miles Song <bodasong@amazon.com> * fix fanout operations Signed-off-by: Miles Song <bodasong@amazon.com> * rebase; add slot consistency check in ft.info Signed-off-by: Miles Song <bodasong@amazon.com> * fix integration tests Signed-off-by: Miles Song <bodasong@amazon.com> --------- Signed-off-by: Miles Song <bodasong@amazon.com> * Limit and Nocontent support for non vector queries (valkey-io#522) * Limit and Nocontent support for non vector Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com> * use ReplyAvailNeighbors Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com> * Use ReplyAvailNeighbors Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com> * fmt Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com> * Add integ testing for non vector queries with LIMIT and NOCONTENT Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com> * include tests for CME Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com> * add limit Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com> --------- Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com> * Fix compatibility test for ft.search use-cases (not included yet). Add documentation * Fix test Signed-off-by: Allen Samuels <allenss@amazon.com> * Add documentation Signed-off-by: Allen Samuels <allenss@amazon.com> --------- Signed-off-by: Allen Samuels <allenss@amazon.com> * Full support for DB numbers other than zero in cluster mode. (valkey-io#410) * Initial IndexName encode/decode Signed-off-by: Allen Samuels <allenss@amazon.com> * working now Signed-off-by: Allen Samuels <allenss@amazon.com> * format Signed-off-by: Allen Samuels <allenss@amazon.com> * formatting, remove unneded logs Signed-off-by: Allen Samuels <allenss@amazon.com> * spelling Signed-off-by: Allen Samuels <allenss@amazon.com> * formatting Signed-off-by: Allen Samuels <allenss@amazon.com> * Update for aggregation Signed-off-by: Allen Samuels <allenss@amazon.com> * Rewrite per feedback, move encoding into metadata_manager Signed-off-by: Allen Samuels <allenss@amazon.com> * fix merge errors Signed-off-by: Allen Samuels <allenss@amazon.com> * Revise per-object Encoding Version Signed-off-by: Allen Samuels <allenss@amazon.com> * fix integration test Signed-off-by: Allen Samuels <allenss@amazon.com> * Enhance metadata tests Signed-off-by: Allen Samuels <allenss@amazon.com> * Update semantic versioning Signed-off-by: Allen Samuels <allenss@amazon.com> * Implement schema-level versioning Signed-off-by: Allen Samuels <allenss@amazon.com> * include omitted test file Signed-off-by: Allen Samuels <allenss@amazon.com> * fix valkey version post GA Signed-off-by: Allen Samuels <allenss@amazon.com> * remove old drop option Signed-off-by: Allen Samuels <allenss@amazon.com> * delete check Signed-off-by: Allen Samuels <allenss@amazon.com> * remerge Signed-off-by: Allen Samuels <allenss@amazon.com> * fix integration test Signed-off-by: Allen Samuels <allenss@amazon.com> * redo Signed-off-by: Allen Samuels <allenss@amazon.com> * more Signed-off-by: Allen Samuels <allenss@amazon.com> * better Signed-off-by: Allen Samuels <allenss@amazon.com> * more Signed-off-by: Allen Samuels <allenss@amazon.com> * Fixes for non-routable Signed-off-by: Allen Samuels <allenss@amazon.com> * fix unit tests Signed-off-by: Allen Samuels <allenss@amazon.com> * Fix last test mismatch Signed-off-by: Allen Samuels <allenss@amazon.com> * Introduce ObjName Signed-off-by: Allen Samuels <allenss@amazon.com> * Revert "feat: set command info for ft.create (valkey-io#299)" This reverts commit c50f841. Signed-off-by: Allen Samuels <allenss@amazon.com> * cleanup Signed-off-by: Allen Samuels <allenss@amazon.com> * Cleanup 1 Signed-off-by: Allen Samuels <allenss@amazon.com> * cleanup 2 Signed-off-by: Allen Samuels <allenss@amazon.com> * cleanup 3 Signed-off-by: Allen Samuels <allenss@amazon.com> --------- Signed-off-by: Allen Samuels <allenss@amazon.com> * Fix replica crash by using legacy ACL path during replication (valkey-io#510) * Fix replica crash by using legacy ACL path during replication Modify AclPrefixCheck to use the new fast ACL API only for real user clients. During replication context, fall back to the legacy ACL path which has proper safety checks and prevents segmentation fault in VM_GetModuleUserFromUserName. This approach: - Preserves fast ACL checking for real users when new API is available - Uses safe legacy path during replication/AOF/internal operations - Prevents crashes while maintaining performance benefits Fixes crash introduced in commit e9f277c when ACL checking was added. * DCO Remediation Commit for Elias Tamraz <tamrazelias@gmail.com> I, Elias Tamraz <tamrazelias@gmail.com>, hereby add my Signed-off-by to this commit: 0384de5 Address code review feedback: - Add early return for non-real users to avoid unnecessary work - Replace conditional check with assertion for better error handling Co-authored-by: yairgott Signed-off-by: Elias Tamraz <tamrazelias@gmail.com> --------- Signed-off-by: Elias Tamraz <tamrazelias@gmail.com> * use negate flag parser in ft.info parser (valkey-io#524) Signed-off-by: Miles Song <bodasong@amazon.com> * Fix Aggregation processing of LOAD clause and validation of vector query parameters. (valkey-io#527) * Fix test Signed-off-by: Allen Samuels <allenss@amazon.com> * Add documentation Signed-off-by: Allen Samuels <allenss@amazon.com> * Validate vector distances. Fix aggregation LOAD with only __key and/or score. Fix aggregation limits checking Signed-off-by: Allen Samuels <allenss@amazon.com> --------- Signed-off-by: Allen Samuels <allenss@amazon.com> * Change default Valkey to 9.0.1 release (valkey-io#528) Signed-off-by: Allen Samuels <allenss@amazon.com> * refresh cluster map in background (valkey-io#531) Signed-off-by: Miles Song <bodasong@amazon.com> * Fix flaky test (valkey-io#530) * Fix flaky test Signed-off-by: Allen Samuels <allenss@amazon.com> * Fix CME too Signed-off-by: Allen Samuels <allenss@amazon.com> --------- Signed-off-by: Allen Samuels <allenss@amazon.com> * DCO Remediation Commit for Allen Samuels <allenss@amazon.com> I, Allen Samuels <allenss@amazon.com>, hereby add my Signed-off-by to this commit: c2c1e7b I, Allen Samuels <allenss@amazon.com>, hereby add my Signed-off-by to this commit: be8b236 Signed-off-by: Allen Samuels <allenss@amazon.com> DCO Remediation Commit for eifrah-aws <eifrah@amazon.com> I, eifrah-aws <eifrah@amazon.com>, hereby add my Signed-off-by to this commit: e9f277c I, eifrah-aws <eifrah@amazon.com>, hereby add my Signed-off-by to this commit: cdfe0c4 I, eifrah-aws <eifrah@amazon.com>, hereby add my Signed-off-by to this commit: de64571 Signed-off-by: eifrah-aws <eifrah@amazon.com> DCO Remediation Commit for Elias Tamraz <51382208+eliastam@users.noreply.github.com> I, Elias Tamraz <51382208+eliastam@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 990efa0 Signed-off-by: Elias Tamraz <51382208+eliastam@users.noreply.github.com> DCO Remediation Commit for Hyeonho Kim <jwalag87@gmail.com> I, Hyeonho Kim <jwalag87@gmail.com>, hereby add my Signed-off-by to this commit: c50f841 Signed-off-by: Hyeonho Kim <jwalag87@gmail.com> DCO Remediation Commit for KarthikSubbarao <karthikrs2021@gmail.com> I, KarthikSubbarao <karthikrs2021@gmail.com>, hereby add my Signed-off-by to this commit: 6706ea2 Signed-off-by: KarthikSubbarao <karthikrs2021@gmail.com> DCO Remediation Commit for Miles Song <54991825+boda26@users.noreply.github.com> I, Miles Song <54991825+boda26@users.noreply.github.com>, hereby add my Signed-off-by to this commit: d90a358 I, Miles Song <54991825+boda26@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 57e5dfd I, Miles Song <54991825+boda26@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 0026dfc I, Miles Song <54991825+boda26@users.noreply.github.com>, hereby add my Signed-off-by to this commit: b81574a I, Miles Song <54991825+boda26@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 31d37d9 I, Miles Song <54991825+boda26@users.noreply.github.com>, hereby add my Signed-off-by to this commit: 4da6e96 Signed-off-by: Miles Song <54991825+boda26@users.noreply.github.com> Signed-off-by: Miles Song <bodasong@amazon.com> --------- Signed-off-by: Miles Song <bodasong@amazon.com> Signed-off-by: Eran Ifrah <eifrah@amazon.com> Signed-off-by: yulazariy <yulazari@amazon.com> Signed-off-by: Allen Samuels <allenss@amazon.com> Signed-off-by: proost <jwalag87@gmail.com> Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com> Signed-off-by: Elias Tamraz <tamrazelias@gmail.com> Signed-off-by: Miles Song <54991825+boda26@users.noreply.github.com> Co-authored-by: Allen Samuels <allenss@amazon.com> Co-authored-by: eifrah-aws <eifrah@amazon.com> Co-authored-by: yulazariy <yulazari@amazon.com> Co-authored-by: Hyeonho Kim <jwalag87@gmail.com> Co-authored-by: KarthikSubbarao <karthikrs2021@gmail.com> Co-authored-by: Elias Tamraz <51382208+eliastam@users.noreply.github.com>
Signed-off-by: Manish Addanki <daddaman@amazon.com>
…AND Intersection wrapping cases (valkey-io#544) Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com>
Signed-off-by: Allen Samuels <allenss@amazon.com>
…ocations (valkey-io#554) Signed-off-by: Karthik Subbarao <karthikrs2021@gmail.com>
--------- Signed-off-by: Manish Addanki <daddaman@amazon.com>
…ey-io#568) Signed-off-by: Manish Addanki <daddaman@amazon.com>
* Flat Position Map Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * Flat Position Map test Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * cmake changes Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * lot of fixes and changes Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * clang format Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * clang format Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * fixed memory allocation tracking in flat_position_map and implemented skipforward position Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * small fix Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * clang Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * Multiple refactoring changes Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * asan fix Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * New redesign changes Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * clang changes Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * clang changes Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * formatting changes Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * some formatting and test changes Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * some test changes Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * Addressed Allens comments Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * clang changes Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * random stress tests on flat posiiton map Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * clang changes Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * some more changes Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * redesign 2 Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * minor comments addressing Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * clang changes Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * minor change Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * minor change Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * minor change Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * clang changes Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * minor change Signed-off-by: Aksha Thakkar <thaakb@amazon.com> * clang changes Signed-off-by: Aksha Thakkar <thaakb@amazon.com> --------- Signed-off-by: Aksha Thakkar <thaakb@amazon.com> Co-authored-by: Aksha Thakkar <thaakb@amazon.com>
Negation querying with schema level tracked/untracked keys Signed-off-by: Ram Prasad Voleti <ramvolet@amazon.com>
allenss-amazon
left a comment
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.
Overall, it's definitely advantageous to think of the problem as a state machine: Phase1, Phase2 and Done -- and it should be documented as such. When I read the code, I believe it's true that the phase variable is a redundantly encoded version of the tracked and untracked iterators. In other words:
- Phase1 <=> tracked_iterator != end.
- Phase2 <=> tracked_iterator == end && untracked_iterator != end.
- Done <=> tracked_iterator == end && untracked_iterator == end.
Generally, having redundant state is undesirable because:
- It increases the cognitive load on the future code reader/maintainer as there are more pieces of state floating around.
- It increases the complexity of the code as there's extra code to maintain the duplicate state.
- It's error prone because the duplicate state can get out of sync without careful coding.
One hybrid solution would be to create a few simple boolean functions like IsPhase1() and IsPhase2(), etc.
src/indexes/text.cc
Outdated
| auto fetcher = std::make_unique<indexes::Text::EntriesFetcher>( | ||
| estimated_size, GetTextIndexSchema()->GetTextIndex(), nullptr, | ||
| GetFieldMask()); | ||
| fetcher->predicate_ = this; | ||
| return fetcher.release(); | ||
| } | ||
|
|
||
| auto positive_iterator = BuildTextIterator( | ||
| std::make_unique<indexes::Text::EntriesFetcher>( | ||
| estimated_size, GetTextIndexSchema()->GetTextIndex(), nullptr, | ||
| GetFieldMask()) | ||
| .get()); |
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 would make more sense, if you setup the positive iterator unconditionally (since it's used in all paths) and then conditionally wrapped it in the negative iterator.
Also, I notice that one path assigns fetch->predicate_, but the other path doesn't. This asymmetry sticks out as a potential issue.
| while (tracked_iter_ != schema_tracked_keys_.end() && | ||
| matched_keys_.contains(*tracked_iter_)) { | ||
| ++tracked_iter_; | ||
| } | ||
|
|
||
| if (tracked_iter_ == schema_tracked_keys_.end()) { | ||
| phase_ = | ||
| (untracked_iter_ != schema_untracked_keys_.end()) ? UNTRACKED : DONE; | ||
| } |
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.
Isn't the point of this code to align the iterator to the first valid key? Wouldn't it be true that if you setup the correct initialization of iterators/phases you should be able to just call NextKey here, right?
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.
Sentinel logic doesn't help here because with empty sets iterator cannot distinguish between begin(uninitialized) and end(exhausted) but we need to position at first valid key at initialization. Will add initialization variable and we can move this logic to nextKey.
| while (phase_ != DONE && CurrentKey() < target_key) { | ||
| if (phase_ == TRACKED) { | ||
| do { | ||
| ++tracked_iter_; | ||
| if (tracked_iter_ == schema_tracked_keys_.end()) { | ||
| phase_ = (untracked_iter_ != schema_untracked_keys_.end()) ? UNTRACKED | ||
| : DONE; | ||
| break; | ||
| } | ||
| } while (matched_keys_.contains(*tracked_iter_)); | ||
| } else { | ||
| ++untracked_iter_; | ||
| if (untracked_iter_ == schema_untracked_keys_.end()) { | ||
| phase_ = DONE; | ||
| } | ||
| } | ||
| } |
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.
Why isn't the loop a call to NextKey() ?
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.
Aah yes.
|
@allenss-amazon Agreed about redundant version of track/untracked state machine. Will follow the suggestion and name the functions as |
Address comments of PR. Remove redundant stae machine for tracked/untracked keys. Make positive iterator unconditional. Signed-off-by: Ram Prasad Voleti <ramvolet@amazon.com>
|
@VoletiRam - Can we update the PR? From the history rewrite change (for fixing the history), the PR has other changes included as well |
|
When I read this code earlier, I saw it was missing handling from the PredicateEvaluator (predicate.cc) from the main thread verification. Can we include this as well? There can be mutations since the time of the background search and the main thread verification + reply stage |
b10f919 to
ce6d869
Compare
| uint64_t Text::GetRecordCount() const { | ||
| size_t Text::GetTrackedKeyCount() const { | ||
| // TODO: keep track of number of keys indexed for this attribute | ||
| return 0; |
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.
@VoletiRam
Currently ft.info 's num_records in using this function and since we return zero, text is not being accounted for in that
Will your PR be implementing tracked key count or is this something not relevant for text since we have shared structure?
Negation querying with schema level tracked/untracked keys. Negation logic:
total keys - matching keys = negation result