Skip to content

Commit 1c173c8

Browse files
committed
MB-66543: Add support in cbvbucketctl for StopFusionUploader
Change-Id: Id074687631a39eb66fe6902ec5a87b34085e0d43 Reviewed-on: https://review.couchbase.org/c/kv_engine/+/234485 Reviewed-by: Pavlos Georgiou <[email protected]> Tested-by: Build Bot <[email protected]>
1 parent 614657f commit 1c173c8

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

engines/ep/management/cbvbucketctl

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ licenses/APL2.txt.
1212
"""
1313

1414
from cli_auth_utils import get_authed_clitool, cmd_decorator
15+
import mc_bin_client
1516

1617

1718
@cmd_decorator
@@ -30,17 +31,35 @@ def setvb(mc, vbid, vbstate, value):
3031
def rmvb(mc, vbid):
3132
mc.delete_vbucket(int(vbid))
3233

34+
3335
@cmd_decorator
3436
def mountvb(mc, vbid, value):
3537
mc.mount_vbucket(int(vbid), value)
3638

3739

40+
@cmd_decorator
41+
def stop_fusion_uploader(mc, vbucket, force=False):
42+
mc.stop_fusion_uploader(int(vbucket))
43+
print(f'Fusion uploader stopped for vb:{vbucket}')
44+
45+
3846
if __name__ == '__main__':
39-
c = get_authed_clitool(allBuckets=False)
47+
usage = """
48+
stop_fusion_uploader:
49+
1 parameter
50+
vbucket - ID of the vbucket to stop fusion uploader on
51+
Example: Stop fusion uploader on vbucket 23
52+
cbvbucketctl host:port -b default stop_fusion_uploader 23
53+
"""
54+
55+
c = get_authed_clitool(usage, allBuckets=False)
4056

4157
c.addCommand('list', listvb, 'list')
42-
c.addCommand('set', setvb, 'set <vbid> active|replica|pending|dead <value>')
58+
c.addCommand(
59+
'set', setvb, 'set <vbid> active|replica|pending|dead <value>')
4360
c.addCommand('rm', rmvb, 'rm <vbid>')
4461
c.addCommand('mount', mountvb, 'mount <vbid> <value>')
62+
c.addCommand('stop_fusion_uploader', stop_fusion_uploader,
63+
'stop_fusion_uploader <vbid>')
4564

4665
c.execute()

engines/ep/management/clitool.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ def format_command_list(self):
103103
for c in cmds:
104104
output += " %s\n" % c
105105

106-
output = output[:-1]
107-
108-
output += self.extraUsage
106+
output += "\n\n" + self.extraUsage
109107

110108
return output

engines/ep/management/mc_bin_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,11 @@ def sasl_auth_cram_md5(self, user, password):
813813
return self._doCmd(memcacheConstants.CMD_SASL_STEP, 'CRAM-MD5',
814814
user + ' ' + dig)
815815

816+
def stop_fusion_uploader(self, vbucket):
817+
assert isinstance(vbucket, int)
818+
self.vbucketId = vbucket
819+
return self._doCmd(memcacheConstants.CMD_STOP_FUSION_UPLOADER, '', '')
820+
816821
def stop_persistence(self):
817822
return self._doCmd(memcacheConstants.CMD_STOP_PERSISTENCE, '', '')
818823

0 commit comments

Comments
 (0)