-
Notifications
You must be signed in to change notification settings - Fork 42
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
Overhaul wal for create workload #534
Conversation
测试的时候发现有比较大的疏漏, 挑出其中一个来说, workload 可能的状态表:
仔细分析代码可以发现上面五种状态都有可能产生, 完全取决于 crash 的时机; |
1 怎么出来的。。。 |
回滚步骤里, 会先删数据, 再删实例, 如果在中间 crash 了就是状态 1 了. 不过我想到了一个简单点的做法. |
d6da4e9
to
1f31358
Compare
针对 create WAL 的问题:
|
cluster/calcium/create.go
Outdated
@@ -55,14 +55,33 @@ func (c *Calcium) doCreateWorkloads(ctx context.Context, opts *types.DeployOptio | |||
defer func() { | |||
cctx, cancel := context.WithTimeout(utils.InheritTracingInfo(ctx, context.TODO()), c.config.GlobalTimeout) | |||
for nodename := range deployMap { | |||
if e := c.store.DeleteProcessing(cctx, opts.GetProcessing(nodename)); e != nil { | |||
processing := opts.GetProcessing(nodename) | |||
if e := c.store.DeleteProcessing(cctx, processing); e != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err 统一
engine/engine.go
Outdated
@@ -41,7 +41,7 @@ type API interface { | |||
VirtualizationCopyTo(ctx context.Context, ID, target string, content []byte, uid, gid int, mode int64) error | |||
VirtualizationStart(ctx context.Context, ID string) error | |||
VirtualizationStop(ctx context.Context, ID string, gracefulTimeout time.Duration) error | |||
VirtualizationRemove(ctx context.Context, ID string, volumes, force bool) error | |||
VirtualizationRemove(ctx context.Context, ID string, volumes, force bool) (int, error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
夹带私货了啊,其实我觉得吧你搞个常量定义可能直观些
LGTM |
var processingCommits map[string]wal.Commit | ||
defer func() { | ||
for nodename := range processingCommits { | ||
if err := processingCommits[nodename](); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make sure the processingCommits[nodename]
is callable or nil while c.wal.Log
returns an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加了一个判断
43b0bb2
to
cd21b45
Compare
LGTM |
No description provided.