Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update basic.rst #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

update basic.rst #5

wants to merge 1 commit into from

Conversation

JuwanXu
Copy link

@JuwanXu JuwanXu commented Jul 14, 2020

No description provided.

@@ -40,7 +40,7 @@ memtable被创建时,leveldb的后台压缩进程便会将利用其中的内
log
~~~

leveldb的写操作并不是直接写入磁盘的,而是首先写入到内存。假设写入到内存的数据还未来得及持久化,leveldb进程发生了异常,抑或是宿主机器发生了宕机,会造成用户的写入发生丢失。因此leveldb在写内存之前会首先将所有的写操作写到日志文件中,也就是log文件。当以下异常情况发生时,均可以通过日志文件进行恢复:
leveldb的写操作并不是直接写入内存的,而是首先写入到磁盘。假设写入到内存的数据还未来得及持久化,leveldb进程发生了异常,抑或是宿主机器发生了宕机,会造成用户的写入发生丢失。因此leveldb在写内存之前会首先将所有的写操作写到日志文件中,也就是log文件。当以下异常情况发生时,均可以通过日志文件进行恢复:
Copy link
Owner

Choose a reason for hiding this comment

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

感谢!但是我认为在这里想表达的意思是:

Leveldb的写操作是更新memory db并返回,并不是直接触发一次磁盘写入。

或者我们可以更改为

leveldb在发生写操作时用户数据并不是直接写入磁盘的,而是将其缓存于内存中。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants