[
https://issues.apache.org/jira/browse/HBASE-23573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16995336#comment-16995336
]
刘本龙 commented on HBASE-23573:
-----------------------------
如下代码:会收集到一批syncFuture,一起处理。但是在循环中统计syncCount时,就提前notify
客户端线程,使其可以继续工作。试想一下:如果此时客户端线程收到了写入成功的响应,但是这一批次syncCount还没有处理完,memstore中的数据也没有写入到hfile,此时机器断电了,memstore中的数据丢失,本来要写入wal的日志也还没来得及调用hflush,也会丢失。那么客户端收到的notify通知提前继续执行代码了,假设该线程已经通知到hbase
client,那么client和服务器的数据是不一致的,客户端认为已经成功,但是服务器并没有。
那么等这一批sysfuture都sync成功后,再统一notify写入数据的线程,可以提高一些数据可靠性。
The following code: A batch of syncFuture will be collected and processed
together. However, when the syncCount is counted in the loop, the client thread
is notified in advance so that it can continue to work. Imagine: If the client
thread receives a successful write response at this time, but this batch of
syncCount has not been processed, the data in memstore has not been written to
hfile, at this time the machine is powered off, and the data in memstore Lost.
The log that was originally written to wal has not been timed to call hflush,
and it will be lost. Then the client received the notify notification to
continue to execute the code in advance. Assuming that the thread has notified
the hbase client, the data of the client and the server is inconsistent. The
client considers it successful, but the server does not.
Then after this batch of sysfutures have successfully synced, and then notify
the thread that writes data, you can improve some data reliability.
thank you.
!image-2019-12-13-11-41-42-200.png|width=730,height=469!
> can not guarantee consistency.
> ------------------------------
>
> Key: HBASE-23573
> URL: https://issues.apache.org/jira/browse/HBASE-23573
> Project: HBase
> Issue Type: Bug
> Components: wal
> Affects Versions: 2.1.5
> Reporter: 刘本龙
> Priority: Major
> Attachments: image-2019-12-13-11-41-42-200.png
>
>
> wal sync has not exe, but has notified thread . if RegionServer halt,such as
> Power off. the client think the write was successful, but the write failed.
> the data writed into memstore is loss , wal has not data too。
>
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)