aboutsummaryrefslogtreecommitdiff
path: root/weed/server/master_grpc_server_admin.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-04-23 03:50:05 -0700
committerChris Lu <chris.lu@gmail.com>2020-04-23 03:50:05 -0700
commitbdc337a71938dfa0821203a79dd4a0f7e69df6ab (patch)
tree9630b9291db0274704bbe78ab43b080fe2a7e18e /weed/server/master_grpc_server_admin.go
parent57ec7f2ba925dbe5335164a58a4c8dc496b34d2b (diff)
downloadseaweedfs-bdc337a71938dfa0821203a79dd4a0f7e69df6ab.tar.xz
seaweedfs-bdc337a71938dfa0821203a79dd4a0f7e69df6ab.zip
make lock/unlock optional
Diffstat (limited to 'weed/server/master_grpc_server_admin.go')
-rw-r--r--weed/server/master_grpc_server_admin.go18
1 files changed, 2 insertions, 16 deletions
diff --git a/weed/server/master_grpc_server_admin.go b/weed/server/master_grpc_server_admin.go
index 8cc04f575..b986a93a2 100644
--- a/weed/server/master_grpc_server_admin.go
+++ b/weed/server/master_grpc_server_admin.go
@@ -18,8 +18,6 @@ Shell
When shell lock,
* lease an admin token (lockTime, token)
* start a goroutine to renew the admin token periodically
-For later volume operations, send (lockTime, token) to volume servers for exclusive access
- * need to pause renewal a few seconds, to prevent race condition
When shell unlock
* stop the renewal goroutine
@@ -48,13 +46,9 @@ When master receives the lease/renew request from shell
When master receives the release lock request from shell
set the lastLockTime to zero
-When master receives the verfication request from volume servers
- return secret+lockTime == token && lockTime == lastLockTime
-
-Volume
-------
-When receives (lockTime, token), ask the master whether this is valid
+The volume server does not need to verify.
+This makes the lock/unlock optional, similar to what golang code usually does.
*/
@@ -97,11 +91,3 @@ func (ms *MasterServer) ReleaseAdminToken(ctx context.Context, req *master_pb.Re
}
return resp, nil
}
-
-func (ms *MasterServer) VerifyAdminToken(ctx context.Context, req *master_pb.VerifyAdminTokenRequest) (*master_pb.VerifyAdminTokenResponse, error) {
- resp := &master_pb.VerifyAdminTokenResponse{}
- if ms.isValidToken(time.Unix(0, req.LockTime), req.Token) {
- resp.IsValid = true
- }
- return resp, nil
-}