Skip to content

Commit

Permalink
Release v1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dingfeng committed Apr 22, 2024
1 parent d82cdb3 commit b4557ff
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 47 deletions.
51 changes: 25 additions & 26 deletions build/images/polardbx-clinic/diagnose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,10 @@ dump_obj(){
kubectl -n "$current_ns" logs "$line" "$container" --since=24h > $base_dir/"$line"_"$container".log
done
if [ "$log_type" == "cn" ]; then
# echo "collect /home/drds-server/logs/tddl/ logs ... for "$line
kubectl -n "$current_ns" exec -it "$line" -- bash -c "cd /home/admin/drds-server/logs/tddl && tar zcvf tddllog.tar.gz *.log"
kubectl -n "$current_ns" cp "$line":/home/admin/drds-server/logs/tddl/tddllog.tar.gz $base_dir/"$line"-tddlog.tar.gz
kubectl -n "$current_ns" exec -it "$line" -- rm -f /home/admin/drds-server/logs/tddl/tddllog.tar.gz
if ! [ -f cn.sql ]; then
if ! [ -f diagnose_cn.sql ]; then
echo "
select 'select version()';
select version();
Expand All @@ -130,11 +129,11 @@ dump_obj(){
show full processlist;
select 'show variables';
show variables;
" > cn.sql
" > diagnose_cn.sql
fi
echo "exec cn.sql in "$line
kubectl -n "$current_ns" cp cn.sql "$line":cn.sql
kubectl -n "$current_ns" exec -it "$line" -- bash -c "myc -e 'source cn.sql'" > $base_dir/"$line"-cmdresponse.log
echo "exec diagnose_cn.sql in "$line
kubectl -n "$current_ns" cp diagnose_cn.sql "$line":diagnose_cn.sql
kubectl -n "$current_ns" exec -it "$line" -- bash -c "myc -e 'source diagnose_cn.sql'" > $base_dir/"$line"-cmdresponse.log
common_dump "$current_ns" "$line" $base_dir/"$line"-cmdresponse.log
fi
if [ "$log_type" == "dn" ]; then
Expand All @@ -145,7 +144,7 @@ dump_obj(){
echo "exec mysql -V in "$line
echo "mysql -V" >> $base_dir/"$line"-cmdresponse.log
kubectl -n "$current_ns" exec -it $line -- mysqld -V >> $base_dir/"$line"-cmdresponse.log
if ! [ -f dn.sql ]; then
if ! [ -f diagnose_dn.sql ]; then
echo "
select version();
select 'show processlist';
Expand All @@ -162,11 +161,11 @@ dump_obj(){
show consensus logs \G;
select 'show slave status';
show slave status \G;
" > dn.sql
" > diagnose_dn.sql
fi
echo "exec dn.sql in ""$line"
kubectl -n "$current_ns" cp dn.sql "$line":dn.sql
kubectl -n "$current_ns" exec -it "$line" -- myc -e 'source dn.sql' >> $base_dir/"$line"-cmdresponse.log
echo "exec diagnose_dn.sql in ""$line"
kubectl -n "$current_ns" cp diagnose_dn.sql "$line":diagnose_dn.sql
kubectl -n "$current_ns" exec -it "$line" -- myc -e 'source diagnose_dn.sql' >> $base_dir/"$line"-cmdresponse.log
common_dump "$current_ns" "$line" $base_dir/"$line"-cmdresponse.log
fi
if [ "$log_type" == "cdc" ]; then
Expand All @@ -191,37 +190,37 @@ dump_obj(){


desensitize(){
sed -i -E 's/(password: ).*/\1******/' $operator_ns/configmap/*.yaml
sed -i -E 's/(minioAccessKey: ).*/\1******/' $operator_ns/configmap/*.yaml
sed -i -E 's/(minioSecretKey: ).*/\1******/' $operator_ns/configmap/*.yaml
sed -i -E 's/(accessKey: ).*/\1******/' $operator_ns/configmap/*.yaml
sed -i -E 's/(accessSecret: ).*/\1******/' $operator_ns/configmap/*.yaml
sed -i -E 's/(oss_access_key: ).*/\1******/' $operator_ns/configmap/*.yaml
sed -i -E 's/(oss_access_secret: ).*/\1******/' $operator_ns/configmap/*.yaml
sed -i -E 's/(password: ).*/\1******/' $operator_ns/ConfigMap/*.yaml
sed -i -E 's/(minioAccessKey: ).*/\1******/' $operator_ns/ConfigMap/*.yaml
sed -i -E 's/(minioSecretKey: ).*/\1******/' $operator_ns/ConfigMap/*.yaml
sed -i -E 's/(accessKey: ).*/\1******/' $operator_ns/ConfigMap/*.yaml
sed -i -E 's/(accessSecret: ).*/\1******/' $operator_ns/ConfigMap/*.yaml
sed -i -E 's/(oss_access_key: ).*/\1******/' $operator_ns/ConfigMap/*.yaml
sed -i -E 's/(oss_access_secret: ).*/\1******/' $operator_ns/ConfigMap/*.yaml
}


main(){
res_types=("pxc" "xstore" "pxcblog" "pxb" "pbs" "pxcknobs" "pxlc" "pxm" "pxp" "pxpt" "st" "xsblog" "xsbackup" "xf" "deployment" "node")
res_types=("PolarDBXCluster" "XStore" "PolarDBXBackupBinlog" "PolarDBXBackup" "PolarDBXBackupSchedule" "PolarDBXLogCollector" "PolarDBXMonitor" "PolarDBXParameter" "PolarDBXParameterTemplate" "SystemTask" "XStoreBackupBinlog" "XStoreBackup" "XStoreFollower" "Deployment" "Node")
for res_type in "${res_types[@]}"
do
dump_obj $namespace $res_type &
done
wait
dump_obj "$namespace" pod "polardbx/role=cn" 1 1 cn &
dump_obj "$namespace" pod "xstore/node-role" 1 1 dn &
dump_obj "$namespace" pod "polardbx/role=cdc" 1 1 cdc &
dump_obj "$namespace" configmap "polardbx/name" && dump_obj "$namespace" configmap "xstore/name" &
dump_obj "$namespace" Pod "polardbx/role=cn" 1 1 cn &
dump_obj "$namespace" Pod "xstore/node-role" 1 1 dn &
dump_obj "$namespace" Pod "polardbx/role=cdc" 1 1 cdc &
dump_obj "$namespace" ConfigMap "polardbx/name" && dump_obj "$namespace" ConfigMap "xstore/name" &
wait


res_types_for_operator=("deployment" "ds")
res_types_for_operator=("Deployment" "DaemonSet")
for res_type_for_operator in "${res_types_for_operator[@]}"
do
dump_obj $operator_ns $res_type_for_operator &
done
dump_obj $operator_ns configmap "" 0 0 "" polardbx &
dump_obj $operator_ns pod "" 1 1 "" &
dump_obj $operator_ns ConfigMap "" 0 0 "" polardbx &
dump_obj $operator_ns Pod "" 1 1 "" &
wait
kubectl get nodes -o custom-columns=NAME:.metadata.name,CPU:.status.capacity.cpu,MEMORY:.status.capacity.memory,ALLOCATABLE_CPU:.status.allocatable.cpu,ALLOCATABLE_MEMORY:.status.allocatable.memory > noderesourcelist.txt
desensitize
Expand Down
3 changes: 2 additions & 1 deletion build/images/polardbx-clinic/install_tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ gpgkey=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/repodata/repomd.xml.key
EOF

yum install -y kubectl
yum install -y which
yum install -y which
yum install -y tree
4 changes: 2 additions & 2 deletions charts/polardbx-logcollector/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: polardbx-logcollector
description: Helm chart of polardbx-operator logcollector plugin
type: application
version: 1.6.0-beta
appVersion: v1.6.0-beta
version: 1.6.0
appVersion: v1.6.0
keywords:
- polardb-x
- operator
Expand Down
4 changes: 2 additions & 2 deletions charts/polardbx-monitor/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: polardbx-monitor
description: Helm chart of polardbx-operator monitor plugin
type: application
version: 1.6.0-beta
appVersion: v1.6.0-beta
version: 1.6.0
appVersion: v1.6.0
keywords:
- polardb-x
- operator
Expand Down
4 changes: 2 additions & 2 deletions charts/polardbx-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: polardbx-operator
description: Helm chart of polardbx-operator
type: application
version: 1.6.0-beta
appVersion: v1.6.0-beta
version: 1.6.0
appVersion: v1.6.0
keywords:
- polardb-x
- operator
Expand Down
4 changes: 2 additions & 2 deletions charts/polardbx-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ images:
polardbxClinic: polardbx-clinic

# Default image tag. Use app version if not specified or 'latest' if useLatestImage is true.
imageTag: v1.6.0-beta
imageTag: v1.6.0

# version will be written to pxc and xstore annotation
version: v1.6.0-beta
version: v1.6.0

# Uses the latest images for operator components.
useLatestImage: false
Expand Down
4 changes: 2 additions & 2 deletions hack/copy_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@


SOURCE_REPO=polarximages-registry.cn-zhangjiakou.cr.aliyuncs.com/daixingpolarximages
SOURCE_VERSION=v1.6.0-beta-2
SOURCE_VERSION=v1.6.0
DEST_REPO=polardbx
DEST_VERSION=v1.6.0-beta
DEST_VERSION=v1.6.0
TARGETS="xstore-tools polardbx-operator probe-proxy polardbx-exporter polardbx-init polardbx-hpfs polardbx-job polardbx-clinic polardbx-logstash"

#pull from source image and tag it
Expand Down
14 changes: 8 additions & 6 deletions pkg/operator/v1/xstore/controllers/xstore_backup_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ func (r *XStoreBackupReconciler) Reconcile(ctx context.Context, request reconcil
}

// Record the context of the corresponding xstore
xstore, err := rc.GetXStore()
if err != nil {
log.Error(err, "Unable to get corresponding xstore")
return reconcile.Result{}, err
}
xstoreRequest := request
xstoreRequest.Name = xstore.Name
if xstoreBackup.GetDeletionTimestamp().IsZero() { // If request to delete, no need to care about xstore
xstore, err := rc.GetXStore()
if err != nil {
log.Error(err, "Unable to get corresponding xstore")
return reconcile.Result{}, err
}
xstoreRequest.Name = xstore.Name
}
xstoreRc := xstorev1reconcile.NewContext(
control.NewBaseReconcileContextFrom(r.BaseRc, ctx, xstoreRequest),
r.LoaderFactory(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ func (r *GalaxyBackupReconciler) Reconcile(rc *xstorev1reconcile.BackupContext,
backup := rc.MustGetXStoreBackup()
log = log.WithValues("phase", backup.Status.Phase)

isStandard, err := rc.GetXStoreIsStandard()
if err != nil {
log.Error(err, "Unable to get corresponding xstore")
return reconcile.Result{}, err
isStandard := true
var err error
if backup.GetDeletionTimestamp().IsZero() {
isStandard, err = rc.GetXStoreIsStandard()
if err != nil {
log.Error(err, "Unable to get corresponding xstore")
return reconcile.Result{}, err
}
}
task, err := r.newReconcileTask(rc, backup, log, isStandard)
if err != nil {
Expand Down

0 comments on commit b4557ff

Please sign in to comment.