pingcap / pingcap/tiflash

Feature: detect the memory setting of OS during starting up

Open
#1,824 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type/feature-request
Dominant language
C++
Stars
1k
Forks
423
Avg merge
1d 15h
Merged PRs (30d)
24

Description

https://internal.pingcap.net/jira/browse/ONCALL-2841 is caused by allocating memory error.

from https://stackoverflow.com/questions/59043520/dberrnoexception-allocator-cannot-malloc-1-00-mib-errno-12-strerror-can

https://clickhouse.yandex/docs/en/operations/tips/#ram

Do not disable overcommit. The value cat /proc/sys/vm/overcommit_memory should be 0 or 1.

Check max_map_count cat /proc/sys/vm/max_map_count and set max_map_count to 1048576

so tiflash should detect the overcommit_memory during starting up to avoid this error.

Request from zhuangpeipei.

Contributor guide

No contributing guide indexed for this repository

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

No source file or test is named in the issue. Start by locating TiFlash's Linux startup path and the code handling memory allocation, then inspect how /proc/sys/vm/overcommit_memory and /proc/sys/vm/max_map_count are read. Done means startup detects the overcommit setting and addresses the reported allocation failure condition without disabling overcommit.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.