Skip to content
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

[ENH]: parallelize applying materialized log to segment writers #3359

Merged
merged 4 commits into from
Jan 3, 2025

Conversation

codetheweb
Copy link
Contributor

@codetheweb codetheweb commented Dec 27, 2024

Description of changes

Applies log updates to segment types in parallel rather than sequentially:

Screenshot 2024-12-27 at 10 30 03

Pipelining flushes to S3/applying to blockfile will be in the next PR in this stack.

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Also tested with SciDocs.

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs repository?

n/a

Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@@ -280,7 +280,7 @@ impl CompactOrchestrator {
None => return,
};

self.num_write_tasks = partitions.len() as i32;
self.num_write_tasks = partitions.len() as i32 * 3;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is removed in the next PR in this stack

&self,
record_segment_reader: &Option<RecordSegmentReader>,
materialized_chunk: &MaterializeLogsResult,
) -> Result<(), ApplyMaterializedLogError>;
) -> impl Future<Output = Result<(), ApplyMaterializedLogError>> + Send;
Copy link
Collaborator

@HammadB HammadB Jan 2, 2025

Choose a reason for hiding this comment

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

Interesting, the impl can still be async fn apply_materialized_log_chunk and this works? Is this because async is just syntactic sugar for that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep

@codetheweb codetheweb force-pushed the feat-materialize-operator-2 branch from b25da8b to 88c8462 Compare January 2, 2025 22:07
@codetheweb codetheweb force-pushed the perf-parallelize-applying-log-2 branch from 2e9a2e0 to d09d690 Compare January 2, 2025 22:07
Copy link
Contributor Author

codetheweb commented Jan 3, 2025

Merge activity

  • Jan 3, 11:14 AM EST: A user started a stack merge that includes this pull request via Graphite.
  • Jan 3, 11:19 AM EST: Graphite rebased this pull request as part of a merge.
  • Jan 3, 11:20 AM EST: A user merged this pull request with Graphite.

@codetheweb codetheweb changed the base branch from feat-materialize-operator-2 to graphite-base/3359 January 3, 2025 16:14
@codetheweb codetheweb changed the base branch from graphite-base/3359 to main January 3, 2025 16:16
@codetheweb codetheweb force-pushed the perf-parallelize-applying-log-2 branch from d09d690 to 23ef45e Compare January 3, 2025 16:18
@codetheweb codetheweb merged commit 894663c into main Jan 3, 2025
76 of 77 checks passed
@codetheweb codetheweb deleted the perf-parallelize-applying-log-2 branch January 3, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants