Are all data written to memory first during the execution of TiDB DML?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TiDB DML执行过程中的所有数据都是先写到内存吗?

| username: alfred

[TiDB Usage Environment] Production Environment / Testing / POC
[TiDB Version]
[Encountered Issues]
[Reproduction Path] What operations were performed to encounter the issue
[Issue Phenomenon and Impact]

[Attachments]

Please provide the version information of each component, such as cdc/tikv, which can be obtained by executing cdc version/tikv-server --version.

| username: xfworld | Original post link

Yes, TiDB nodes rely on memory for temporary storage and then schedule transactions. Once the transactions are committed, the memory is released.

| username: ddhe9527 | Original post link

Write operations are first written to the memory (membuffer) of the TiDB instance, and then written to the memory of TiKV (RocksDB’s memtable) upon commit.

| username: alfred | Original post link

Lock information is written directly to the disk, right?

| username: ddhe9527 | Original post link

Locks are the same; there is a WAL when writing to the memtable.

| username: alfred | Original post link

Yes, writing the WAL first is a must.

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.