Skip to content

Add test to isolate InitialMmapSize delay without read transaction#1137

Merged
ahrtr merged 1 commit into
etcd-io:mainfrom
Elbehery:20260117_verify_big_initMmap_win
Jan 20, 2026
Merged

Add test to isolate InitialMmapSize delay without read transaction#1137
ahrtr merged 1 commit into
etcd-io:mainfrom
Elbehery:20260117_verify_big_initMmap_win

Conversation

@Elbehery

@Elbehery Elbehery commented Jan 17, 2026

Copy link
Copy Markdown
Member

This PR adds TestDB_Open_InitialMmapSize_Windows_NoReader to isolate the root cause of write commit delays on Windows with large InitialMmapSize values.

Steps

  1. Opening a DB with InitialMmapSize = 1GB on all platforms
  2. Creating a write transaction
  3. Writing 134MB of data
  4. Committing the write with a 5-second timeout
  5. Measuring and logging the actual commit time

cc @ahrtr @ivanvc

Comment thread db_test.go Outdated
// InitialMmapSize values when there is NO concurrent read transaction.
// This test helps isolate whether delays in TestDB_Open_InitialMmapSize are caused
// by the large InitialMmapSize itself or by reader-writer interaction.
func TestDB_Open_InitialMmapSize_Windows_NoReader(t *testing.T) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This test is very similar to TestDB_Open_InitialMmapSize, please just update that case to include table driven sub tests

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's leave it as it's for now, this case is already good enough to verify the thought #1136 (comment).

Once it's verified, we can merge it into TestDB_Open_InitialMmapSize.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

lgtm 👍🏽

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I retried several times, and couldn't reproduce the issue so far. Please merge this test case into TestDB_Open_InitialMmapSize, so that we can two sub test (table driven). thx

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ptal 👍🏽

@Elbehery
Elbehery force-pushed the 20260117_verify_big_initMmap_win branch from 2a39804 to 6edccd0 Compare January 20, 2026 13:41

@ahrtr ahrtr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM with several minor comments, thx

Comment thread db_test.go Outdated
Comment thread db_test.go Outdated
Comment thread db_test.go Outdated
Comment thread db_test.go Outdated
TestDB_Open_InitialMmapSize_Windows_NoReader verifies whether large InitialMmapSize
values (1GB) cause write commit delays even without concurrent read transactions.
This isolates whether the delays observed in TestDB_Open_InitialMmapSize are caused
by the large InitialMmapSize itself or by reader-writer interaction.

Signed-off-by: Mustafa Elbehery <elbeherymustafa@gmail.com>
@Elbehery
Elbehery force-pushed the 20260117_verify_big_initMmap_win branch from 6edccd0 to c7755a2 Compare January 20, 2026 14:33

@ahrtr ahrtr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks

@k8s-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahrtr, Elbehery

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ahrtr
ahrtr merged commit 008659d into etcd-io:main Jan 20, 2026
45 checks passed
@Elbehery
Elbehery deleted the 20260117_verify_big_initMmap_win branch March 25, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants