baidu / baidu/tera

区分current丢失和current本就没有生成

Open
#1,220 1 comment 0 reactions 0 assignees View on GitHub
class/bug module/ts stat/ready-to-do
Dominant language
C++
Stars
1.9k
Forks
432
PR merge metrics
No merged PRs in 30d

Description

tablet第一次load时NewDB()会先生成manifest,再生成current。

情况1.
生成manifest以后立刻就crash了,没来得及生成current. 此时重新load一次。

情况2.
正常生成manifest和current,然而current立刻就丢了,此时发生了一次迁移,重新load一次。

这2种情况貌似不太容易区分?

我的想法:
NewDB()先生成manifest,再生成current这个过程,在一个临时目录里进行,完成以后move成lg0/lg1这类目录。因为current后续都是move生成的,预期应该是都在的,不在就是丢失。

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating NewDB(), the manifest/current creation flow, and the tablet reload and migration paths. Compare the two failure cases and evaluate the proposed temporary-directory move; done means reload can distinguish a current that was never generated from one that was subsequently lost, with evidence for both cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
databases
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.