opensearch-project / opensearch-project/data-prepper

Provide an outgoing buffer mechanism for peer forwarder

Open
#2,153 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
374
Forks
354
Avg merge
3d 18h
Merged PRs (30d)
8

Description

Is your feature request related to a problem? Please describe.

The core peer forwarder does not buffer outgoing requests between pipeline batches. It only buffers within a pipeline batch.

An example: Say the incoming buffer's batch_size is set to 50 and there are 5 Data Prepper nodes. Presumably, each batch has 40 requests to send to the 4 peers. Data Prepper will send 4 requests each of size 10.

Describe the solution you'd like

Provide a configuration within Data Prepper to allow peer-forwarding to batch requests before sending them. There would be two configurations:

  1. A target batch size. Data Prepper will send this number of messages once enough have accumulated.
  2. A timeout for sending. If this time is reached before accumulating enough messages, send the batch data out. This can help with window durations.

Configuration example:

peer_forwarder:
  batch:
    batch_size: 400
    timeout: 2s

When the peer forwarder has received enough messages for the batch_size, it will send exactly the batch_size number of requests. Any other will be batched for the next request. If there are enough left over for another batch_size, these also should be sent immediately.

However, when the timeout is reached for a given batch, that batch will be sent regardless of size. This timeout should start as soon as the batch is started (with the first event added to it).

Additional context

The issue #2147 is possibly caused by too small of batch sizes in HTTP requests.

The requests #2118 could be worked with this task. That is requesting parallel sends rather than sequential. The work probably overlaps.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the core peer forwarder and its peer_forwarder configuration, then review the batching requirements and the related issues #2147 and #2118. Done means outgoing requests accumulate to the configured batch size, flush on the configured timeout, and handle leftover messages as described without losing the proposed parallel-send considerations.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.