-
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 <[email protected]> * 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 <[email protected]> * Addressed PR comments. Signed-off-by: Eran Ifrah <[email protected]> --------- Signed-off-by: Eran Ifrah <[email protected]> * Fixed regression which broke Ninja builds OO (valkey-io#494) * Fixed regression which broke Ninja builds OO Signed-off-by: Eran Ifrah <[email protected]> * 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 <[email protected]> --------- Signed-off-by: Eran Ifrah <[email protected]> * 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 <[email protected]> * fix clang format Signed-off-by: yulazariy <[email protected]> * Fix the low utilization to use the cluster map mechanism Signed-off-by: yulazariy <[email protected]> * Move all prefer local node logic to fanout.cc. minor build fixes Signed-off-by: yulazariy <[email protected]> * Fix formating Signed-off-by: yulazariy <[email protected]> * Revert new timeout function Signed-off-by: yulazariy <[email protected]> --------- Signed-off-by: yulazariy <[email protected]> * Populate fingerprint and version to IndexSchema (valkey-io#480) * populate fingerprint and version to IndexSchema Signed-off-by: Miles Song <[email protected]> * remove logs Signed-off-by: Miles Song <[email protected]> * minor fix according to comments Signed-off-by: Miles Song <[email protected]> * load rdb integration tests Signed-off-by: Miles Song <[email protected]> * fix clang tidy Signed-off-by: Miles Song <[email protected]> * clean protobuf; populate fingerprint/version in MetadataManager::OnLoadingEnd Signed-off-by: Miles Song <[email protected]> * rebase Signed-off-by: Miles Song <[email protected]> * fix integration/run.sh and disable full trace Signed-off-by: Miles Song <[email protected]> * fix according to comments Signed-off-by: Miles Song <[email protected]> * fix spellcheck Signed-off-by: Miles Song <[email protected]> --------- Signed-off-by: Miles Song <[email protected]> * Fix warnings and formatting (valkey-io#503) Signed-off-by: Allen Samuels <[email protected]> * 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 <[email protected]> Co-authored-by: Allen Samuels <[email protected]> * feat: set command info for ft.create (valkey-io#299) * feat: set command info for ft.create Signed-off-by: proost <[email protected]> * fix: add file Signed-off-by: proost <[email protected]> * fix: wrong command arg format Signed-off-by: proost <[email protected]> * test: remove print Signed-off-by: proost <[email protected]> * test: fix broken test Signed-off-by: proost <[email protected]> * fix: wrong sub args Signed-off-by: proost <[email protected]> * style: format Signed-off-by: proost <[email protected]> * style: follow lint Signed-off-by: proost <[email protected]> * style: follow lint Signed-off-by: proost <[email protected]> --------- Signed-off-by: proost <[email protected]> Signed-off-by: Allen Samuels <[email protected]> Co-authored-by: Allen Samuels <[email protected]> * FT.SEARCH partition and consistency controls (valkey-io#464) * allshards/someshards for ft.search Signed-off-by: Miles Song <[email protected]> * ft.search partition tests Signed-off-by: Miles Song <[email protected]> * ft.search partition and consistency controls Signed-off-by: Miles Song <[email protected]> * fix ft.search partition controls test Signed-off-by: Miles Song <[email protected]> * fix format Signed-off-by: Miles Song <[email protected]> * add configurable PreferConsistentResults Signed-off-by: Miles Song <[email protected]> * refactor duplicate code in server.cc Signed-off-by: Miles Song <[email protected]> * rebase; populate fingerprint/version from IndexSchema Signed-off-by: Miles Song <[email protected]> * remove optional in proto; always check index schema consistency Signed-off-by: Miles Song <[email protected]> --------- Signed-off-by: Miles Song <[email protected]> * FT.INFO partition and consistency controls (valkey-io#469) * move fingeprint version check to server.cc Signed-off-by: Miles Song <[email protected]> * ft.info partition and consistency controls Signed-off-by: Miles Song <[email protected]> * remove unused logs Signed-off-by: Miles Song <[email protected]> * add lock for onresponse Signed-off-by: Miles Song <[email protected]> * fix according to comments Signed-off-by: Miles Song <[email protected]> * rebase from main; populate fingerprint/version from IndexSchema in server.cc Signed-off-by: Miles Song <[email protected]> * fix fanout operations Signed-off-by: Miles Song <[email protected]> * rebase; add slot consistency check in ft.info Signed-off-by: Miles Song <[email protected]> * fix integration tests Signed-off-by: Miles Song <[email protected]> --------- Signed-off-by: Miles Song <[email protected]> * Limit and Nocontent support for non vector queries (valkey-io#522) * Limit and Nocontent support for non vector Signed-off-by: Karthik Subbarao <[email protected]> * use ReplyAvailNeighbors Signed-off-by: Karthik Subbarao <[email protected]> * Use ReplyAvailNeighbors Signed-off-by: Karthik Subbarao <[email protected]> * fmt Signed-off-by: Karthik Subbarao <[email protected]> * Add integ testing for non vector queries with LIMIT and NOCONTENT Signed-off-by: Karthik Subbarao <[email protected]> * include tests for CME Signed-off-by: Karthik Subbarao <[email protected]> * add limit Signed-off-by: Karthik Subbarao <[email protected]> --------- Signed-off-by: Karthik Subbarao <[email protected]> * Fix compatibility test for ft.search use-cases (not included yet). Add documentation * Fix test Signed-off-by: Allen Samuels <[email protected]> * Add documentation Signed-off-by: Allen Samuels <[email protected]> --------- Signed-off-by: Allen Samuels <[email protected]> * Full support for DB numbers other than zero in cluster mode. (valkey-io#410) * Initial IndexName encode/decode Signed-off-by: Allen Samuels <[email protected]> * working now Signed-off-by: Allen Samuels <[email protected]> * format Signed-off-by: Allen Samuels <[email protected]> * formatting, remove unneded logs Signed-off-by: Allen Samuels <[email protected]> * spelling Signed-off-by: Allen Samuels <[email protected]> * formatting Signed-off-by: Allen Samuels <[email protected]> * Update for aggregation Signed-off-by: Allen Samuels <[email protected]> * Rewrite per feedback, move encoding into metadata_manager Signed-off-by: Allen Samuels <[email protected]> * fix merge errors Signed-off-by: Allen Samuels <[email protected]> * Revise per-object Encoding Version Signed-off-by: Allen Samuels <[email protected]> * fix integration test Signed-off-by: Allen Samuels <[email protected]> * Enhance metadata tests Signed-off-by: Allen Samuels <[email protected]> * Update semantic versioning Signed-off-by: Allen Samuels <[email protected]> * Implement schema-level versioning Signed-off-by: Allen Samuels <[email protected]> * include omitted test file Signed-off-by: Allen Samuels <[email protected]> * fix valkey version post GA Signed-off-by: Allen Samuels <[email protected]> * remove old drop option Signed-off-by: Allen Samuels <[email protected]> * delete check Signed-off-by: Allen Samuels <[email protected]> * remerge Signed-off-by: Allen Samuels <[email protected]> * fix integration test Signed-off-by: Allen Samuels <[email protected]> * redo Signed-off-by: Allen Samuels <[email protected]> * more Signed-off-by: Allen Samuels <[email protected]> * better Signed-off-by: Allen Samuels <[email protected]> * more Signed-off-by: Allen Samuels <[email protected]> * Fixes for non-routable Signed-off-by: Allen Samuels <[email protected]> * fix unit tests Signed-off-by: Allen Samuels <[email protected]> * Fix last test mismatch Signed-off-by: Allen Samuels <[email protected]> * Introduce ObjName Signed-off-by: Allen Samuels <[email protected]> * Revert "feat: set command info for ft.create (valkey-io#299)" This reverts commit c50f841. Signed-off-by: Allen Samuels <[email protected]> * cleanup Signed-off-by: Allen Samuels <[email protected]> * Cleanup 1 Signed-off-by: Allen Samuels <[email protected]> * cleanup 2 Signed-off-by: Allen Samuels <[email protected]> * cleanup 3 Signed-off-by: Allen Samuels <[email protected]> --------- Signed-off-by: Allen Samuels <[email protected]> * 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 <[email protected]> I, Elias Tamraz <[email protected]>, 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 <[email protected]> --------- Signed-off-by: Elias Tamraz <[email protected]> * use negate flag parser in ft.info parser (valkey-io#524) Signed-off-by: Miles Song <[email protected]> * fix text index Signed-off-by: Miles Song <[email protected]> * fix format Signed-off-by: Miles Song <[email protected]> --------- Signed-off-by: Miles Song <[email protected]> Signed-off-by: Eran Ifrah <[email protected]> Signed-off-by: yulazariy <[email protected]> Signed-off-by: Allen Samuels <[email protected]> Signed-off-by: proost <[email protected]> Signed-off-by: Karthik Subbarao <[email protected]> Signed-off-by: Elias Tamraz <[email protected]> Co-authored-by: Allen Samuels <[email protected]> Co-authored-by: eifrah-aws <[email protected]> Co-authored-by: yulazariy <[email protected]> Co-authored-by: Hyeonho Kim <[email protected]> Co-authored-by: KarthikSubbarao <[email protected]> Co-authored-by: Elias Tamraz <[email protected]> DCO Remediation Commit for Allen Samuels <[email protected]> I, Allen Samuels <[email protected]>, hereby add my Signed-off-by to this commit: c2c1e7b I, Allen Samuels <[email protected]>, hereby add my Signed-off-by to this commit: be8b236 Signed-off-by: Allen Samuels <[email protected]> Third-Party DCO Remediation Commit for eifrah-aws <[email protected]> On behalf of eifrah-aws <[email protected]>, I, Allen Samuels <[email protected]>, hereby add my Signed-off-by to this commit: e9f277c On behalf of eifrah-aws <[email protected]>, I, Allen Samuels <[email protected]>, hereby add my Signed-off-by to this commit: cdfe0c4 On behalf of eifrah-aws <[email protected]>, I, Allen Samuels <[email protected]>, hereby add my Signed-off-by to this commit: de64571 Signed-off-by: Allen Samuels <[email protected]> Third-Party DCO Remediation Commit for Elias Tamraz <[email protected]> On behalf of Elias Tamraz <[email protected]>, I, Allen Samuels <[email protected]>, hereby add my Signed-off-by to this commit: 990efa0 Signed-off-by: Allen Samuels <[email protected]> Third-Party DCO Remediation Commit for Hyeonho Kim <[email protected]> On behalf of Hyeonho Kim <[email protected]>, I, Allen Samuels <[email protected]>, hereby add my Signed-off-by to this commit: c50f841 Signed-off-by: Allen Samuels <[email protected]> Third-Party DCO Remediation Commit for KarthikSubbarao <[email protected]> On behalf of KarthikSubbarao <[email protected]>, I, Allen Samuels <[email protected]>, hereby add my Signed-off-by to this commit: 6706ea2 Signed-off-by: Allen Samuels <[email protected]> Third-Party DCO Remediation Commit for Miles Song <[email protected]> On behalf of Miles Song <[email protected]>, I, Allen Samuels <[email protected]>, hereby add my Signed-off-by to this commit: d90a358 On behalf of Miles Song <[email protected]>, I, Allen Samuels <[email protected]>, hereby add my Signed-off-by to this commit: 57e5dfd On behalf of Miles Song <[email protected]>, I, Allen Samuels <[email protected]>, hereby add my Signed-off-by to this commit: 0026dfc On behalf of Miles Song <[email protected]>, I, Allen Samuels <[email protected]>, hereby add my Signed-off-by to this commit: b81574a On behalf of Miles Song <[email protected]>, I, Allen Samuels <[email protected]>, hereby add my Signed-off-by to this commit: 31d37d9 Signed-off-by: Allen Samuels <[email protected]>
Pre-filter evaluation (valkey-io#505) --------- Signed-off-by: Manish Addanki <[email protected]>
Signed-off-by: Brennan Cathcart <[email protected]>
Signed-off-by: Brennan Cathcart <[email protected]>
* Revise Save/Restore for true pit snapshot. (valkey-io#401) * fix mem leak in unit test (valkey-io#492) Signed-off-by: Miles Song <[email protected]> * 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 <[email protected]> * Addressed PR comments. Signed-off-by: Eran Ifrah <[email protected]> --------- Signed-off-by: Eran Ifrah <[email protected]> * Fixed regression which broke Ninja builds OO (valkey-io#494) * Fixed regression which broke Ninja builds OO Signed-off-by: Eran Ifrah <[email protected]> * 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 <[email protected]> --------- Signed-off-by: Eran Ifrah <[email protected]> * 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 <[email protected]> * fix clang format Signed-off-by: yulazariy <[email protected]> * Fix the low utilization to use the cluster map mechanism Signed-off-by: yulazariy <[email protected]> * Move all prefer local node logic to fanout.cc. minor build fixes Signed-off-by: yulazariy <[email protected]> * Fix formating Signed-off-by: yulazariy <[email protected]> * Revert new timeout function Signed-off-by: yulazariy <[email protected]> --------- Signed-off-by: yulazariy <[email protected]> * Populate fingerprint and version to IndexSchema (valkey-io#480) * populate fingerprint and version to IndexSchema Signed-off-by: Miles Song <[email protected]> * remove logs Signed-off-by: Miles Song <[email protected]> * minor fix according to comments Signed-off-by: Miles Song <[email protected]> * load rdb integration tests Signed-off-by: Miles Song <[email protected]> * fix clang tidy Signed-off-by: Miles Song <[email protected]> * clean protobuf; populate fingerprint/version in MetadataManager::OnLoadingEnd Signed-off-by: Miles Song <[email protected]> * rebase Signed-off-by: Miles Song <[email protected]> * fix integration/run.sh and disable full trace Signed-off-by: Miles Song <[email protected]> * fix according to comments Signed-off-by: Miles Song <[email protected]> * fix spellcheck Signed-off-by: Miles Song <[email protected]> --------- Signed-off-by: Miles Song <[email protected]> * Fix warnings and formatting (valkey-io#503) Signed-off-by: Allen Samuels <[email protected]> * 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 <[email protected]> Co-authored-by: Allen Samuels <[email protected]> * feat: set command info for ft.create (valkey-io#299) * feat: set command info for ft.create Signed-off-by: proost <[email protected]> * fix: add file Signed-off-by: proost <[email protected]> * fix: wrong command arg format Signed-off-by: proost <[email protected]> * test: remove print Signed-off-by: proost <[email protected]> * test: fix broken test Signed-off-by: proost <[email protected]> * fix: wrong sub args Signed-off-by: proost <[email protected]> * style: format Signed-off-by: proost <[email protected]> * style: follow lint Signed-off-by: proost <[email protected]> * style: follow lint Signed-off-by: proost <[email protected]> --------- Signed-off-by: proost <[email protected]> Signed-off-by: Allen Samuels <[email protected]> Co-authored-by: Allen Samuels <[email protected]> * FT.SEARCH partition and consistency controls (valkey-io#464) * allshards/someshards for ft.search Signed-off-by: Miles Song <[email protected]> * ft.search partition tests Signed-off-by: Miles Song <[email protected]> * ft.search partition and consistency controls Signed-off-by: Miles Song <[email protected]> * fix ft.search partition controls test Signed-off-by: Miles Song <[email protected]> * fix format Signed-off-by: Miles Song <[email protected]> * add configurable PreferConsistentResults Signed-off-by: Miles Song <[email protected]> * refactor duplicate code in server.cc Signed-off-by: Miles Song <[email protected]> * rebase; populate fingerprint/version from IndexSchema Signed-off-by: Miles Song <[email protected]> * remove optional in proto; always check index schema consistency Signed-off-by: Miles Song <[email protected]> --------- Signed-off-by: Miles Song <[email protected]> * FT.INFO partition and consistency controls (valkey-io#469) * move fingeprint version check to server.cc Signed-off-by: Miles Song <[email protected]> * ft.info partition and consistency controls Signed-off-by: Miles Song <[email protected]> * remove unused logs Signed-off-by: Miles Song <[email protected]> * add lock for onresponse Signed-off-by: Miles Song <[email protected]> * fix according to comments Signed-off-by: Miles Song <[email protected]> * rebase from main; populate fingerprint/version from IndexSchema in server.cc Signed-off-by: Miles Song <[email protected]> * fix fanout operations Signed-off-by: Miles Song <[email protected]> * rebase; add slot consistency check in ft.info Signed-off-by: Miles Song <[email protected]> * fix integration tests Signed-off-by: Miles Song <[email protected]> --------- Signed-off-by: Miles Song <[email protected]> * Limit and Nocontent support for non vector queries (valkey-io#522) * Limit and Nocontent support for non vector Signed-off-by: Karthik Subbarao <[email protected]> * use ReplyAvailNeighbors Signed-off-by: Karthik Subbarao <[email protected]> * Use ReplyAvailNeighbors Signed-off-by: Karthik Subbarao <[email protected]> * fmt Signed-off-by: Karthik Subbarao <[email protected]> * Add integ testing for non vector queries with LIMIT and NOCONTENT Signed-off-by: Karthik Subbarao <[email protected]> * include tests for CME Signed-off-by: Karthik Subbarao <[email protected]> * add limit Signed-off-by: Karthik Subbarao <[email protected]> --------- Signed-off-by: Karthik Subbarao <[email protected]> * Fix compatibility test for ft.search use-cases (not included yet). Add documentation * Fix test Signed-off-by: Allen Samuels <[email protected]> * Add documentation Signed-off-by: Allen Samuels <[email protected]> --------- Signed-off-by: Allen Samuels <[email protected]> * Full support for DB numbers other than zero in cluster mode. (valkey-io#410) * Initial IndexName encode/decode Signed-off-by: Allen Samuels <[email protected]> * working now Signed-off-by: Allen Samuels <[email protected]> * format Signed-off-by: Allen Samuels <[email protected]> * formatting, remove unneded logs Signed-off-by: Allen Samuels <[email protected]> * spelling Signed-off-by: Allen Samuels <[email protected]> * formatting Signed-off-by: Allen Samuels <[email protected]> * Update for aggregation Signed-off-by: Allen Samuels <[email protected]> * Rewrite per feedback, move encoding into metadata_manager Signed-off-by: Allen Samuels <[email protected]> * fix merge errors Signed-off-by: Allen Samuels <[email protected]> * Revise per-object Encoding Version Signed-off-by: Allen Samuels <[email protected]> * fix integration test Signed-off-by: Allen Samuels <[email protected]> * Enhance metadata tests Signed-off-by: Allen Samuels <[email protected]> * Update semantic versioning Signed-off-by: Allen Samuels <[email protected]> * Implement schema-level versioning Signed-off-by: Allen Samuels <[email protected]> * include omitted test file Signed-off-by: Allen Samuels <[email protected]> * fix valkey version post GA Signed-off-by: Allen Samuels <[email protected]> * remove old drop option Signed-off-by: Allen Samuels <[email protected]> * delete check Signed-off-by: Allen Samuels <[email protected]> * remerge Signed-off-by: Allen Samuels <[email protected]> * fix integration test Signed-off-by: Allen Samuels <[email protected]> * redo Signed-off-by: Allen Samuels <[email protected]> * more Signed-off-by: Allen Samuels <[email protected]> * better Signed-off-by: Allen Samuels <[email protected]> * more Signed-off-by: Allen Samuels <[email protected]> * Fixes for non-routable Signed-off-by: Allen Samuels <[email protected]> * fix unit tests Signed-off-by: Allen Samuels <[email protected]> * Fix last test mismatch Signed-off-by: Allen Samuels <[email protected]> * Introduce ObjName Signed-off-by: Allen Samuels <[email protected]> * Revert "feat: set command info for ft.create (valkey-io#299)" This reverts commit c50f841. Signed-off-by: Allen Samuels <[email protected]> * cleanup Signed-off-by: Allen Samuels <[email protected]> * Cleanup 1 Signed-off-by: Allen Samuels <[email protected]> * cleanup 2 Signed-off-by: Allen Samuels <[email protected]> * cleanup 3 Signed-off-by: Allen Samuels <[email protected]> --------- Signed-off-by: Allen Samuels <[email protected]> * 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 <[email protected]> I, Elias Tamraz <[email protected]>, 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 <[email protected]> --------- Signed-off-by: Elias Tamraz <[email protected]> * use negate flag parser in ft.info parser (valkey-io#524) Signed-off-by: Miles Song <[email protected]> * Fix Aggregation processing of LOAD clause and validation of vector query parameters. (valkey-io#527) * Fix test Signed-off-by: Allen Samuels <[email protected]> * Add documentation Signed-off-by: Allen Samuels <[email protected]> * Validate vector distances. Fix aggregation LOAD with only __key and/or score. Fix aggregation limits checking Signed-off-by: Allen Samuels <[email protected]> --------- Signed-off-by: Allen Samuels <[email protected]> * Change default Valkey to 9.0.1 release (valkey-io#528) Signed-off-by: Allen Samuels <[email protected]> * refresh cluster map in background (valkey-io#531) Signed-off-by: Miles Song <[email protected]> * Fix flaky test (valkey-io#530) * Fix flaky test Signed-off-by: Allen Samuels <[email protected]> * Fix CME too Signed-off-by: Allen Samuels <[email protected]> --------- Signed-off-by: Allen Samuels <[email protected]> * DCO Remediation Commit for Allen Samuels <[email protected]> I, Allen Samuels <[email protected]>, hereby add my Signed-off-by to this commit: c2c1e7b I, Allen Samuels <[email protected]>, hereby add my Signed-off-by to this commit: be8b236 Signed-off-by: Allen Samuels <[email protected]> DCO Remediation Commit for eifrah-aws <[email protected]> I, eifrah-aws <[email protected]>, hereby add my Signed-off-by to this commit: e9f277c I, eifrah-aws <[email protected]>, hereby add my Signed-off-by to this commit: cdfe0c4 I, eifrah-aws <[email protected]>, hereby add my Signed-off-by to this commit: de64571 Signed-off-by: eifrah-aws <[email protected]> DCO Remediation Commit for Elias Tamraz <[email protected]> I, Elias Tamraz <[email protected]>, hereby add my Signed-off-by to this commit: 990efa0 Signed-off-by: Elias Tamraz <[email protected]> DCO Remediation Commit for Hyeonho Kim <[email protected]> I, Hyeonho Kim <[email protected]>, hereby add my Signed-off-by to this commit: c50f841 Signed-off-by: Hyeonho Kim <[email protected]> DCO Remediation Commit for KarthikSubbarao <[email protected]> I, KarthikSubbarao <[email protected]>, hereby add my Signed-off-by to this commit: 6706ea2 Signed-off-by: KarthikSubbarao <[email protected]> DCO Remediation Commit for Miles Song <[email protected]> I, Miles Song <[email protected]>, hereby add my Signed-off-by to this commit: d90a358 I, Miles Song <[email protected]>, hereby add my Signed-off-by to this commit: 57e5dfd I, Miles Song <[email protected]>, hereby add my Signed-off-by to this commit: 0026dfc I, Miles Song <[email protected]>, hereby add my Signed-off-by to this commit: b81574a I, Miles Song <[email protected]>, hereby add my Signed-off-by to this commit: 31d37d9 I, Miles Song <[email protected]>, hereby add my Signed-off-by to this commit: 4da6e96 Signed-off-by: Miles Song <[email protected]> Signed-off-by: Miles Song <[email protected]> --------- Signed-off-by: Miles Song <[email protected]> Signed-off-by: Eran Ifrah <[email protected]> Signed-off-by: yulazariy <[email protected]> Signed-off-by: Allen Samuels <[email protected]> Signed-off-by: proost <[email protected]> Signed-off-by: Karthik Subbarao <[email protected]> Signed-off-by: Elias Tamraz <[email protected]> Signed-off-by: Miles Song <[email protected]> Co-authored-by: Allen Samuels <[email protected]> Co-authored-by: eifrah-aws <[email protected]> Co-authored-by: yulazariy <[email protected]> Co-authored-by: Hyeonho Kim <[email protected]> Co-authored-by: KarthikSubbarao <[email protected]> Co-authored-by: Elias Tamraz <[email protected]>
Signed-off-by: Manish Addanki <[email protected]>
…AND Intersection wrapping cases (valkey-io#544) Signed-off-by: Karthik Subbarao <[email protected]>
Signed-off-by: Allen Samuels <[email protected]>
…ocations (valkey-io#554) Signed-off-by: Karthik Subbarao <[email protected]>
--------- Signed-off-by: Manish Addanki <[email protected]>
…ey-io#568) Signed-off-by: Manish Addanki <[email protected]>
* Flat Position Map Signed-off-by: Aksha Thakkar <[email protected]> * Flat Position Map test Signed-off-by: Aksha Thakkar <[email protected]> * cmake changes Signed-off-by: Aksha Thakkar <[email protected]> * lot of fixes and changes Signed-off-by: Aksha Thakkar <[email protected]> * clang format Signed-off-by: Aksha Thakkar <[email protected]> * clang format Signed-off-by: Aksha Thakkar <[email protected]> * fixed memory allocation tracking in flat_position_map and implemented skipforward position Signed-off-by: Aksha Thakkar <[email protected]> * small fix Signed-off-by: Aksha Thakkar <[email protected]> * clang Signed-off-by: Aksha Thakkar <[email protected]> * Multiple refactoring changes Signed-off-by: Aksha Thakkar <[email protected]> * asan fix Signed-off-by: Aksha Thakkar <[email protected]> * New redesign changes Signed-off-by: Aksha Thakkar <[email protected]> * clang changes Signed-off-by: Aksha Thakkar <[email protected]> * clang changes Signed-off-by: Aksha Thakkar <[email protected]> * formatting changes Signed-off-by: Aksha Thakkar <[email protected]> * some formatting and test changes Signed-off-by: Aksha Thakkar <[email protected]> * some test changes Signed-off-by: Aksha Thakkar <[email protected]> * Addressed Allens comments Signed-off-by: Aksha Thakkar <[email protected]> * clang changes Signed-off-by: Aksha Thakkar <[email protected]> * random stress tests on flat posiiton map Signed-off-by: Aksha Thakkar <[email protected]> * clang changes Signed-off-by: Aksha Thakkar <[email protected]> * some more changes Signed-off-by: Aksha Thakkar <[email protected]> * redesign 2 Signed-off-by: Aksha Thakkar <[email protected]> * minor comments addressing Signed-off-by: Aksha Thakkar <[email protected]> * clang changes Signed-off-by: Aksha Thakkar <[email protected]> * minor change Signed-off-by: Aksha Thakkar <[email protected]> * minor change Signed-off-by: Aksha Thakkar <[email protected]> * minor change Signed-off-by: Aksha Thakkar <[email protected]> * clang changes Signed-off-by: Aksha Thakkar <[email protected]> * minor change Signed-off-by: Aksha Thakkar <[email protected]> * clang changes Signed-off-by: Aksha Thakkar <[email protected]> --------- Signed-off-by: Aksha Thakkar <[email protected]> Co-authored-by: Aksha Thakkar <[email protected]>
Negation querying with schema level tracked/untracked keys Signed-off-by: Ram Prasad Voleti <[email protected]>
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 <[email protected]>
|
@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