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

Support directory lock #527

Open
yvxiang opened this issue Oct 24, 2016 · 0 comments
Open

Support directory lock #527

yvxiang opened this issue Oct 24, 2016 · 0 comments

Comments

@yvxiang
Copy link
Collaborator

yvxiang commented Oct 24, 2016

  • Store the lock mark in FileInfo
  • Store the lock mark in namespace, and remove the mark when the lock is released. Keep a copy of lock list in memory.
  • Rebuild the lock list when Nameserver restarts. For each locked dir, add all the files under this dir to incomplete list. (Nameserver restarts does not change the dir locking status)
  • Regarding HA: the lock mark should send to slaves/followers via Sync
  • API should includes LockDir and UnlockDir
  • 在FileInfo中持久化locked标记
  • 给目录加锁时将namespace中对应目录的标记位置位,解决锁时将对应标记位清除,同时内存中维护一个已加锁的目录列表
  • nameserver重启时,Rebuild过程中发现该目录被锁,则scan时,将其下所有文件的block扔到incomplete列表中,将对应目录的状态恢复为已加锁(即name server重启时,并不掉锁)
  • HA时的处理:lock unlock都是写namespace,所以天然持久化,若发生切主,则同nameserver重启走相同流程
  • 结构:LockDir和UnlockDir
bluebore added a commit that referenced this issue Nov 2, 2016
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 7, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 8, 2017
@yvxiang yvxiang mentioned this issue Mar 8, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 9, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 9, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 10, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 10, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 10, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 10, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 13, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 13, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 13, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 14, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 14, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 14, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 14, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 14, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 14, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 14, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 15, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 15, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 15, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 16, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 16, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 16, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 16, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 16, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 20, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 20, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 20, 2017
bluebore pushed a commit that referenced this issue Mar 21, 2017
(#527) Add dir lock support
@yvxiang yvxiang mentioned this issue Mar 21, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 21, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 22, 2017
yvxiang pushed a commit to yvxiang/dfs that referenced this issue Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants