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

WIP--Fix CI validator break issue and remove several redis marks in several files #42

Closed
wants to merge 1 commit into from

Conversation

hwware
Copy link
Member

@hwware hwware commented Mar 26, 2024

@@ -1,4 +1,4 @@
# example systemd service unit file for redis-server
# example systemd service unit file for placeholderkv-server
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -20,15 +20,15 @@ proc run-tests branches {
exec -ignorestderr make 2> /dev/null

if {$branch_id == 0} {
puts " copy redis-benchmark from unstable to /tmp..."
exec -ignorestderr cp ./redis-benchmark /tmp
Copy link
Member

@madolson madolson Mar 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bold statement by me, maybe we just delete this file? Has anybody ever run this? I've never seen this before.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me check if this file is necessary. I never use it before.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I run the daily CI without this file, all test cases pass. I think we could remove it safely. (Here is the result https://github.com/hwware/redis/actions/runs/8454862841)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, let's delete it.

@@ -24,7 +24,7 @@ case "$1" in
then
echo "$PIDFILE exists, process is already running or crashed"
else
echo "Starting Redis server..."
echo "Starting Placeholderkv server..."
Copy link
Member

@madolson madolson Mar 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "Starting Placeholderkv server..."
echo "Starting server..."

So we're touching these files just once, let's make it engine agnostic where it makes sense.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, either "server" or use a variable defined only once at the top of the file. In an init script, think it's useful to know which service has been started or stopped.

Copy link
Member

@madolson madolson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good, minor suggestions.

@@ -38,10 +38,10 @@ case "$1" in
$CLIEXEC -p $REDISPORT shutdown
while [ -x /proc/${PID} ]
do
echo "Waiting for Redis to shutdown ..."
echo "Waiting for Placeholderkv to shutdown ..."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "Waiting for Placeholderkv to shutdown ..."
echo "Waiting for server to shutdown ..."

sleep 1
done
echo "Redis stopped"
echo "Placeholderkv stopped"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "Placeholderkv stopped"
echo "server stopped"

@@ -241,7 +241,7 @@ def fetch_schemas(cli, port, args, docs):

while True:
try:
print('Connecting to Redis...')
print('Connecting to Placeholderkv...')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print('Connecting to Placeholderkv...')
print('Connecting to server...')

Comment on lines +285 to +286
# Fetch schemas from a Placeholderkv instance
print('Starting Placeholderkv server')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Fetch schemas from a Placeholderkv instance
print('Starting Placeholderkv server')
# Fetch schemas from a server instance
print('Starting server')

redis_args = [args.server, '--port', str(args.port)]
for module in args.module:
redis_args += ['--loadmodule', 'tests/modules/%s.so' % module]

fetch_schemas(args.cli, args.port, redis_args, docs)

# Fetch schemas from a sentinel
print('Starting Redis sentinel')
print('Starting Placeholderkv sentinel')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print('Starting Placeholderkv sentinel')
print('Starting sentinel instance')

Comment on lines +136 to +137
echo "stop -- Stop Server Cluster instances."
echo "restart -- Restart Server Cluster instances."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "stop -- Stop Server Cluster instances."
echo "restart -- Restart Server Cluster instances."
echo "stop -- Stop Cluster instances."
echo "restart -- Restart Cluster instances."

@@ -131,10 +131,10 @@ then
fi

echo "Usage: $0 [start|create|stop|restart|watch|tail|tailall|clean|clean-logs|call]"
echo "start -- Launch Redis Cluster instances."
echo "start -- Launch Server Cluster instances."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
echo "start -- Launch Server Cluster instances."
echo "start -- Launch Cluster instances."

@@ -28,7 +28,7 @@ then
while [ $((PORT < ENDPORT)) != "0" ]; do
PORT=$((PORT+1))
echo "Starting $PORT"
$BIN_PATH/redis-server --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --appenddirname appendonlydir-${PORT} --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS}
$BIN_PATH/placeholderkv-server --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --appenddirname appendonlydir-${PORT} --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's avoid spelling out "placeholderkv" everywhere, because we will change it soon and backporting these changes will be a PITA.

Let's define near the top of the file

SERVER_BIN=$BIN_PATH/placeholderkv-server
CLI_BIN=$BIN_PATH/placeholderkv-cli

And then use it within this file everywhere, like

Suggested change
$BIN_PATH/placeholderkv-server --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --appenddirname appendonlydir-${PORT} --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS}
$SERVER_BIN --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --appenddirname appendonlydir-${PORT} --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I can temporarily set this PR as WIP, and wait for our project offical name.

@@ -44,7 +44,7 @@ then
if [ "$2" == "-f" ]; then
OPT_ARG="--cluster-yes"
fi
$BIN_PATH/redis-cli --cluster create $HOSTS --cluster-replicas $REPLICAS $OPT_ARG
$BIN_PATH/placeholderkv-cli --cluster create $HOSTS --cluster-replicas $REPLICAS $OPT_ARG
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$BIN_PATH/placeholderkv-cli --cluster create $HOSTS --cluster-replicas $REPLICAS $OPT_ARG
$CLI_BIN --cluster create $HOSTS --cluster-replicas $REPLICAS $OPT_ARG

@@ -53,7 +53,7 @@ then
while [ $((PORT < ENDPORT)) != "0" ]; do
PORT=$((PORT+1))
echo "Stopping $PORT"
$BIN_PATH/redis-cli -p $PORT shutdown nosave
$BIN_PATH/placeholderkv-cli -p $PORT shutdown nosave
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$BIN_PATH/placeholderkv-cli -p $PORT shutdown nosave
$CLI_BIN -p $PORT shutdown nosave

@@ -70,7 +70,7 @@ then
while [ $((PORT < ENDPORT)) != "0" ]; do
PORT=$((PORT+1))
echo "Starting $PORT"
$BIN_PATH/redis-server --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --appenddirname appendonlydir-${PORT} --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS}
$BIN_PATH/placeholderkv-server --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --appenddirname appendonlydir-${PORT} --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$BIN_PATH/placeholderkv-server --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --appenddirname appendonlydir-${PORT} --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS}
$SERVER_BIN --port $PORT --protected-mode $PROTECTED_MODE --cluster-enabled yes --cluster-config-file nodes-${PORT}.conf --cluster-node-timeout $TIMEOUT --appendonly yes --appendfilename appendonly-${PORT}.aof --appenddirname appendonlydir-${PORT} --dbfilename dump-${PORT}.rdb --logfile ${PORT}.log --daemonize yes ${ADDITIONAL_OPTIONS}

@@ -81,7 +81,7 @@ then
while [ 1 ]; do
clear
date
$BIN_PATH/redis-cli -p $PORT cluster nodes | head -30
$BIN_PATH/placeholderkv-cli -p $PORT cluster nodes | head -30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$BIN_PATH/placeholderkv-cli -p $PORT cluster nodes | head -30
$CLI_BIN -p $PORT cluster nodes | head -30

parser.add_argument('--port', type=int, default=6534)
parser.add_argument('--cli', type=str, default='%s/redis-cli' % srcdir)
parser.add_argument('--cli', type=str, default='%s/placeholderkv-cli' % srcdir)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a variable for this and define it in the top of the file.

Comment on lines +23 to +24
puts " copy placeholderkv-benchmark from unstable to /tmp..."
exec -ignorestderr cp ./placeholderkv-benchmark /tmp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a variable for this and define it in the top of the file.

Example:

Suggested change
puts " copy placeholderkv-benchmark from unstable to /tmp..."
exec -ignorestderr cp ./placeholderkv-benchmark /tmp
puts " copy $benchmark from unstable to /tmp..."
exec -ignorestderr cp ./$benchmark /tmp

Comment on lines +29 to +31
# Start the Placeholderkv server
puts " starting the server... [exec ./placeholderkv-server -v]"
set pids [exec echo "port $::port\nloglevel warning\n" | ./placeholderkv-server - > /dev/null 2> /dev/null &]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Start the Placeholderkv server
puts " starting the server... [exec ./placeholderkv-server -v]"
set pids [exec echo "port $::port\nloglevel warning\n" | ./placeholderkv-server - > /dev/null 2> /dev/null &]
# Start the server
puts " starting the server... [exec ./$server -v]"
set pids [exec echo "port $::port\nloglevel warning\n" | ./$server - > /dev/null 2> /dev/null &]

@@ -38,7 +38,7 @@ proc run-tests branches {
puts " redis INFO shows version: [lindex [split $i] 0]"
$r close

set output [exec /tmp/redis-benchmark -n $::requests -t $::tests -d $::datasize --csv -p $::port]
set output [exec /tmp/placeholderkv-benchmark -n $::requests -t $::tests -d $::datasize --csv -p $::port]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set output [exec /tmp/placeholderkv-benchmark -n $::requests -t $::tests -d $::datasize --csv -p $::port]
set output [exec /tmp/$benchmark -n $::requests -t $::tests -d $::datasize --csv -p $::port]

@@ -1,26 +1,26 @@
# example systemd template service unit file for multiple redis-servers
# example systemd template service unit file for multiple placeholderkv-server
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in every other file, I think we shouldn't use "placeholderkv" more than once in each script for defining a variable at the top of the file.

In comments, we can just say server instance and similar words.

@hwware hwware changed the title Fix CI validator break issue and remove several redis marks in several files WIP--Fix CI validator break issue and remove several redis marks in several files Mar 28, 2024
@PingXie PingXie added the rebranding Valkey is not Redis label Apr 2, 2024
@PingXie
Copy link
Member

PingXie commented Apr 2, 2024

@hwware are we still moving forward with this PR?

@hwware
Copy link
Member Author

hwware commented Apr 2, 2024

@hwware are we still moving forward with this PR?

I think I will close this PR, becuase others already create several similar prs to cover this PR changes

@hwware are we still moving forward with this PR?

@hwware hwware closed this Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rebranding Valkey is not Redis
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants