ydb-platform / ydb-platform/ydb-java-sdk

Topic read session can use more memory than specified in settings

Open
#551 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
53
Forks
40
Avg merge
9h 51m
Merged PRs (30d)
7

Description

https://github.com/ydb-platform/ydb-java-sdk/blob/33069043617c46381660128d3528462e5db82b38/topic/src/main/java/tech/ydb/topic/read/impl/ReaderImpl.java#L475

The backpressure API in topics allows to specify the amount of memory that server can fill with messages. Server can send a bit more (less than a single message size). So, we can increase this variable sizeBytesToRequest several times and actual amount of requested memory can slowly increase. Read session must not send sizeBytesToRequest greater that MaxMemoryUsageBytes. Adeally, it must send to server MaxMemoryUsageBytes - usedBytes, where usedBytes is the amount of bytes used by the session.

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 at topic/src/main/java/tech/ydb/topic/read/impl/ReaderImpl.java around line 475 and trace how sizeBytesToRequest changes relative to MaxMemoryUsageBytes. Verify that requests account for the session's used bytes and never exceed the configured maximum, then run the existing topic read tests if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.