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

feat: make grpc insert requests in a batch #1687

Merged

Conversation

MichaelScofield
Copy link
Collaborator

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

Trying to optimize Prometheus remote write.

Now the remote write path is like this:

remote write     ->    grpc insert     ->   `DistInserter`(splits inserts here)      -> Datanodes
(single request)     (single request)       (multiple batching requests)                (parallel)
                                            (other protocols insertions all go here)

Before:

remote write     ->    grpc insert     ->   `DistTable::insert`(splits inserts here) -> Datanodes
(single request)     (multiple requests,    (single request)                         (single request)
                      for each table)

This PR also:

  • makes the inserts in Datanode GRPC interface parallel.
  • makes the table "create-on-insert" parallel (we have to add a distributed lock in Metasrv)
    • will be changed to use procedure soon
  • makes the gRPC server no longer blocks

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

Refer to a related PR or issue link (optional)

@codecov
Copy link

codecov bot commented Jun 1, 2023

Codecov Report

Merging #1687 (8e815be) into develop (8e69aef) will decrease coverage by 0.08%.
The diff coverage is 90.56%.

❗ Current head 8e815be differs from pull request most recent head c4aa773. Consider uploading reports for the commit c4aa773 to get more accurate results

@@             Coverage Diff             @@
##           develop    #1687      +/-   ##
===========================================
- Coverage    86.54%   86.47%   -0.08%     
===========================================
  Files          572      573       +1     
  Lines        92371    92396      +25     
===========================================
- Hits         79941    79896      -45     
- Misses       12430    12500      +70     

src/frontend/src/instance/prometheus.rs Outdated Show resolved Hide resolved
src/common/grpc/src/channel_manager.rs Outdated Show resolved Hide resolved
src/frontend/src/instance/distributed/inserter.rs Outdated Show resolved Hide resolved
src/meta-srv/src/service/router.rs Outdated Show resolved Hide resolved
@MichaelScofield
Copy link
Collaborator Author

@fengjiachun PTAL

src/common/grpc/src/channel_manager.rs Show resolved Hide resolved
src/common/meta/src/rpc/router.rs Outdated Show resolved Hide resolved
src/datanode/src/instance/grpc.rs Outdated Show resolved Hide resolved
src/frontend/src/instance/distributed.rs Show resolved Hide resolved
src/frontend/src/table/insert.rs Outdated Show resolved Hide resolved
src/servers/src/grpc.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@killme2008 killme2008 left a comment

Choose a reason for hiding this comment

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

LGTM

@killme2008 killme2008 enabled auto-merge (squash) June 2, 2023 09:02
@killme2008 killme2008 merged commit 5004cf6 into GreptimeTeam:develop Jun 2, 2023
@MichaelScofield MichaelScofield deleted the feat/batch-grpc-insert branch June 2, 2023 09:11
paomian pushed a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
* feat: make Prometheus remote write in a batch

* rebase

* fix: resolve PR comments

* fix: resolve PR comments

* fix: resolve PR comments
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.

4 participants