Skip to content

Commit

Permalink
Added some disable command additions to the rename-command
Browse files Browse the repository at this point in the history
  • Loading branch information
wuxianrong committed Mar 20, 2024
1 parent 3d62cd6 commit 8e802c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 23 deletions.
10 changes: 6 additions & 4 deletions conf/pika.conf
Original file line number Diff line number Diff line change
Expand Up @@ -519,12 +519,14 @@ cache-lfu-decay-time: 1
# command to modify write commands on the primary and secondary servers. If necessary,
# ensure that the configuration files of the primary and secondary servers are consistent
# In addition, when using the command rename, you must not use "" to modify the command,
# for example, rename-command: FLUSHALL "360flushall" is incorrect; instead, use
# rename-command: FLUSHALL 360flushall is correct. After the rename command is executed,
# for example, rename-command: FLUSHDB "360flushdb" is incorrect; instead, use
# rename-command: FLUSHDB 360flushdb is correct. After the rename command is executed,
# it is most appropriate to use a numeric string with uppercase or lowercase letters
# for example: rename-command : FLUSHALL joYAPNXRPmcarcR4ZDgC81TbdkSmLAzRPmcarcR
# for example: rename-command : FLUSHDB joYAPNXRPmcarcR4ZDgC81TbdkSmLAzRPmcarcR
#
# Warning: setnx, setex, psetex, expire, pexpire, pexpireat, flushall, padding command
# cannot use rename-command change command name
#
# Example:
#
# rename-command : FLUSHALL 360flushall
# rename-command : FLUSHDB 360flushdb
18 changes: 0 additions & 18 deletions tests/integration/renamecommand_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,4 @@ var _ = Describe("Rename Command test", func() {
Expect(r.Val()).NotTo(Equal("OK"))
})

It("should 360FlushAll", func() {
set := client.Set(ctx, "key", "foobar", 0)
Expect(set.Err()).NotTo(HaveOccurred())
Expect(set.Val()).To(Equal("OK"))

bitCount := client.BitCount(ctx, "key", nil)
Expect(bitCount.Err()).NotTo(HaveOccurred())
Expect(bitCount.Val()).To(Equal(int64(26)))
_, err := client.Do(ctx, "360flushall").Result()
Expect(err).NotTo(HaveOccurred())
r := client.Do(ctx, "360flushall")
Expect(r.Val()).To(Equal("OK"))
n, err := client.Exists(ctx, "key").Result()
Expect(err).NotTo(HaveOccurred())
Expect(n).To(Equal(int64(0)))
r = client.Do(ctx, "flushall")
Expect(r.Val()).NotTo(Equal("OK"))
})
})
1 change: 0 additions & 1 deletion tests/integration/start_master_and_slave.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ sed -i '' \
-e 's|#daemonize : yes|daemonize : yes|' ./pika_slave.conf

sed -i '' \
-e 's|# rename-command : FLUSHALL 360flushall|rename-command : FLUSHALL 360flushall|' \
-e 's|# rename-command : FLUSHDB 360flushdb|rename-command : FLUSHDB 360flushdb|' \
-e 's|databases : 1|databases : 2|' \
-e 's|port : 9221|port : 9251|' \
Expand Down

0 comments on commit 8e802c2

Please sign in to comment.