Skip to content

MOD-10017 Rust Counter result processor#6261

Merged
JonasKruckenberg merged 46 commits intomasterfrom
push-oktvzsutusqy
Jun 23, 2025
Merged

MOD-10017 Rust Counter result processor#6261
JonasKruckenberg merged 46 commits intomasterfrom
push-oktvzsutusqy

Conversation

@JonasKruckenberg
Copy link
Collaborator

@JonasKruckenberg JonasKruckenberg commented Jun 5, 2025

Describe the changes in the pull request

This PR ports the RPCounter to Rust without exposing it to C yet. This implements all the machinery and setup, as well as tests required to make sure the new RP behaves exactly as the old RP. Enabling the new RP and switching the codebase over is left for a followup PR.

stacked on top of #6250

Note:
A lot of the design is transient, once more code has been ported to Rust we will revisit certain APIs and update them accordingly. (See MOD-9920, MOD-10230, and MOD-10229)

@github-actions github-actions bot added the size:L label Jun 5, 2025
@JonasKruckenberg JonasKruckenberg force-pushed the push-oktvzsutusqy branch 2 times, most recently from 285da70 to 93c49b4 Compare June 10, 2025 08:54
@JonasKruckenberg JonasKruckenberg force-pushed the push-oktvzsutusqy branch 2 times, most recently from bc559bd to 0d95e10 Compare June 10, 2025 09:41
@codecov
Copy link

codecov bot commented Jun 10, 2025

Codecov Report

Attention: Patch coverage is 92.75362% with 15 lines in your changes missing coverage. Please review.

Project coverage is 88.90%. Comparing base (341f4d4) to head (550b001).
Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
src/redisearch_rs/result_processor/src/lib.rs 91.66% 3 Missing and 4 partials ⚠️
src/redisearch_rs/result_processor/src/counter.rs 86.20% 3 Missing and 1 partial ⚠️
...c/redisearch_rs/result_processor/src/test_utils.rs 95.45% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6261      +/-   ##
==========================================
+ Coverage   88.83%   88.90%   +0.06%     
==========================================
  Files         246      250       +4     
  Lines       41051    41364     +313     
  Branches     3483     3556      +73     
==========================================
+ Hits        36469    36776     +307     
  Misses       4539     4539              
- Partials       43       49       +6     
Flag Coverage Δ
flow 81.46% <ø> (-0.58%) ⬇️
unit 46.97% <92.75%> (+0.49%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JonasKruckenberg JonasKruckenberg force-pushed the push-oktvzsutusqy branch 2 times, most recently from 85be6cc to 690a662 Compare June 10, 2025 11:52
Copy link
Collaborator

@Itzikvaknin Itzikvaknin left a comment

Choose a reason for hiding this comment

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

Please related to the monitoring comments
We need to make sure we integrate "rustic" SearchResult once its ported

///
/// - The caller must never move the allocated result processor from its original allocation.
/// - The caller must ensure to call the `Free` VTable function to properly destroy the type.
#[unsafe(no_mangle)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

isnt it always unsafe?

Comment on lines +45 to +49
impl Default for Counter {
fn default() -> Self {
Self::new()
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it necessary?

self.count += 1;

// Safety: This function should only be called on initialized SearchResults. Luckily,
// a ResultProcessor returning `RPStatus_RS_RESULT_OK` means "Result is filled with valid data"
Copy link
Collaborator

Choose a reason for hiding this comment

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

How is it inferred? (is_some() -> RPStatus_RS_RESULT_OK)

@JonasKruckenberg JonasKruckenberg added this pull request to the merge queue Jun 23, 2025
Merged via the queue into master with commit b0f3a03 Jun 23, 2025
15 checks passed
@JonasKruckenberg JonasKruckenberg deleted the push-oktvzsutusqy branch June 23, 2025 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants