Skip to content

memtx: fix tuple waste size calculation#11652

Merged
sergepetrenko merged 2 commits intotarantool:masterfrom
Gumix:iverbin/gh-10217-fix-tuple-waste-size
Jul 16, 2025
Merged

memtx: fix tuple waste size calculation#11652
sergepetrenko merged 2 commits intotarantool:masterfrom
Gumix:iverbin/gh-10217-fix-tuple-waste-size

Conversation

@Gumix
Copy link
Contributor

@Gumix Gumix commented Jul 10, 2025

The main part of the fix resides in the small submodule, see commit "small: improve real_size calculation in small_alloc_info". Current patch fixes the pointer that is passed to small_alloc_info() - it should point to the memtx_tuple rather than tuple. Also memtx_tuple contains uint32_t version that had not been accounted before, now these 4 bytes are added to the header_size.

Closes #10217

@Gumix Gumix requested a review from a team as a code owner July 10, 2025 19:32
@Gumix Gumix added the do not merge Not ready to be merged label Jul 10, 2025
@coveralls
Copy link

coveralls commented Jul 10, 2025

Coverage Status

coverage: 87.586% (-0.004%) from 87.59%
when pulling 216d262 on Gumix:iverbin/gh-10217-fix-tuple-waste-size
into e204545
on tarantool:master
.

@Gumix Gumix requested review from locker and nshy July 10, 2025 22:57
@Gumix Gumix assigned nshy and locker Jul 10, 2025
Copy link
Contributor

@nshy nshy left a comment

Choose a reason for hiding this comment

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

Nice patch! Glad to see we now have good waste_size calculations without crutches.

@nshy nshy removed their assignment Jul 11, 2025
@locker locker assigned Gumix and unassigned locker Jul 11, 2025
@Gumix Gumix force-pushed the iverbin/gh-10217-fix-tuple-waste-size branch 4 times, most recently from d00bb4f to bdd3471 Compare July 15, 2025 14:21
@Gumix Gumix added full-ci Enables all tests for a pull request and removed do not merge Not ready to be merged labels Jul 15, 2025
@Gumix Gumix force-pushed the iverbin/gh-10217-fix-tuple-waste-size branch from bdd3471 to 8afc16b Compare July 15, 2025 15:17
@Gumix Gumix assigned sergepetrenko and unassigned Gumix Jul 15, 2025
@sergepetrenko sergepetrenko added backport/3.2 Automatically create a 3.2 backport PR backport/3.3 Automatically create a 3.3 backport PR backport/3.4 Automatically create a 3.4 backport PR and removed full-ci Enables all tests for a pull request labels Jul 16, 2025
Gumix added 2 commits July 16, 2025 18:29
* small: drop function declarations without definitions
* small: improve real_size calculation in small_alloc_info

NO_DOC=submodule bump
NO_TEST=submodule bump
NO_CHANGELOG=submodule bump
The main part of the fix resides in the `small` submodule, see commit
"small: improve real_size calculation in small_alloc_info". Current
patch fixes the pointer that is passed to `small_alloc_info()` - it
should point to the `memtx_tuple` rather than `tuple`. Also `memtx_tuple`
contains `uint32_t version` that had not been accounted before, now these
4 bytes are added to the `header_size`.

Closes tarantool#10217

@TarantoolBot document
Title: Remove the note regarding `waste_size` from `tuple_object.info()`
Product: Tarantool
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_tuple/info/#box-tuple-info

Remove the following note: `waste_size` is provided for reference only and
can be inaccurate. Avoid using it for memory usage calculations.
@sergepetrenko sergepetrenko force-pushed the iverbin/gh-10217-fix-tuple-waste-size branch from 8afc16b to 216d262 Compare July 16, 2025 15:30
@sergepetrenko sergepetrenko merged commit 5a052bd into tarantool:master Jul 16, 2025
26 checks passed
@TarantoolBot
Copy link
Collaborator

Successfully created backport PR for release/3.2:

@TarantoolBot
Copy link
Collaborator

Successfully created backport PR for release/3.3:

@TarantoolBot
Copy link
Collaborator

Successfully created backport PR for release/3.4:

@TarantoolBot
Copy link
Collaborator

Backport summary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/3.2 Automatically create a 3.2 backport PR backport/3.3 Automatically create a 3.3 backport PR backport/3.4 Automatically create a 3.4 backport PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tuple waste size reported by memtx looks untrustworthy

7 participants