Skip to content

Commit 0fbf78b

Browse files
committed
update
1 parent 9f5d9e8 commit 0fbf78b

File tree

2 files changed

+47
-47
lines changed

2 files changed

+47
-47
lines changed

scripts/selfhost/restore_logs.sh

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,40 @@
22

33
# Parse arguments
44
while [[ $# -gt 0 ]]; do
5-
case "$1" in
6-
--dsn)
7-
DSN="$2"
8-
shift 2
9-
;;
10-
--stage)
11-
STAGE="$2"
12-
shift 2
13-
;;
14-
*)
15-
if [[ "$1" =~ ^[0-9]{8}$ ]]; then
16-
DATE_ARG="$1"
17-
shift
18-
else
19-
echo "Unknown parameter: $1"
20-
exit 1
21-
fi
22-
;;
23-
esac
5+
case "$1" in
6+
--dsn)
7+
DSN="$2"
8+
shift 2
9+
;;
10+
--stage)
11+
STAGE="$2"
12+
shift 2
13+
;;
14+
*)
15+
if [[ "$1" =~ ^[0-9]{8}$ ]]; then
16+
DATE_ARG="$1"
17+
shift
18+
else
19+
echo "Unknown parameter: $1"
20+
exit 1
21+
fi
22+
;;
23+
esac
2424
done
2525

2626
# Check required parameters
2727
if [[ -z "$STAGE" || -z "$DATE_ARG" ]]; then
28-
echo "Missing required parameters: --stage or yyyymmdd date"
29-
exit 1
28+
echo "Missing required parameters: --stage or yyyymmdd date"
29+
exit 1
3030
fi
3131

3232
# If DSN not provided, try to get from environment variable
3333
if [[ -z "$DSN" ]]; then
34-
DSN="$BENDSQL_DSN"
35-
if [[ -z "$DSN" ]]; then
36-
echo "--dsn parameter not provided and BENDSQL_DSN environment variable not set"
37-
exit 1
38-
fi
34+
DSN="$BENDSQL_DSN"
35+
if [[ -z "$DSN" ]]; then
36+
echo "--dsn parameter not provided and BENDSQL_DSN environment variable not set"
37+
exit 1
38+
fi
3939
fi
4040

4141
# Format date
@@ -49,8 +49,8 @@ DOWNLOAD_SQL="PRESIGN DOWNLOAD @${STAGE}/data_${FORMATTED_DATE}.tar.gz"
4949
DOWNLOAD_URL=$(bendsql --dsn "${DSN}" --query="${DOWNLOAD_SQL}" | awk '{print $3}')
5050

5151
if [[ -z "$DOWNLOAD_URL" ]]; then
52-
echo "Failed to get download URL"
53-
exit 1
52+
echo "Failed to get download URL"
53+
exit 1
5454
fi
5555

5656
# 2. Download the file
@@ -59,8 +59,8 @@ echo "Downloading file: ${TAR_FILE}"
5959
curl -o "${TAR_FILE}" "${DOWNLOAD_URL}"
6060

6161
if [[ ! -f "${TAR_FILE}" ]]; then
62-
echo "File download failed"
63-
exit 1
62+
echo "File download failed"
63+
exit 1
6464
fi
6565

6666
# 3. Extract the file
@@ -76,25 +76,25 @@ bendsql --dsn "${DSN}" --query="DROP STAGE IF EXISTS ${UPLOAD_STAGE}"
7676
bendsql --dsn "${DSN}" --query="CREATE STAGE ${UPLOAD_STAGE}"
7777

7878
find "${TEMP_DIR}" -type f | while read -r FILE; do
79-
RELATIVE_PATH="${FILE#${TEMP_DIR}/}"
79+
RELATIVE_PATH="${FILE#${TEMP_DIR}/}"
8080

81-
# Get upload presigned URL
82-
UPLOAD_SQL="PRESIGN UPLOAD @${UPLOAD_STAGE}/${RELATIVE_PATH}"
83-
UPLOAD_URL=$(bendsql --dsn "${DSN}" --query="${UPLOAD_SQL}" | awk '{print $3}')
81+
# Get upload presigned URL
82+
UPLOAD_SQL="PRESIGN UPLOAD @${UPLOAD_STAGE}/${RELATIVE_PATH}"
83+
UPLOAD_URL=$(bendsql --dsn "${DSN}" --query="${UPLOAD_SQL}" | awk '{print $3}')
8484

85-
if [[ -z "$UPLOAD_URL" ]]; then
86-
echo "Failed to get upload URL for: ${RELATIVE_PATH}"
87-
continue
88-
fi
85+
if [[ -z "$UPLOAD_URL" ]]; then
86+
echo "Failed to get upload URL for: ${RELATIVE_PATH}"
87+
continue
88+
fi
8989

90-
echo "Uploading file: ${RELATIVE_PATH}"
91-
curl -X PUT -T "${FILE}" "${UPLOAD_URL}"
90+
echo "Uploading file: ${RELATIVE_PATH}"
91+
curl -X PUT -T "${FILE}" "${UPLOAD_URL}"
9292

93-
if [[ $? -eq 0 ]]; then
94-
echo "Upload successful: ${RELATIVE_PATH}"
95-
else
96-
echo "Upload failed: ${RELATIVE_PATH}"
97-
fi
93+
if [[ $? -eq 0 ]]; then
94+
echo "Upload successful: ${RELATIVE_PATH}"
95+
else
96+
echo "Upload failed: ${RELATIVE_PATH}"
97+
fi
9898
done
9999

100100
# Cleanup temporary files
@@ -132,4 +132,4 @@ bendsql --dsn "${DSN}" --database "${RESTORE_DATABASE}" --query="create table pr
132132
bendsql --dsn "${DSN}" --database "${RESTORE_DATABASE}" --query="COPY INTO profile_history FROM @${UPLOAD_STAGE}/query_profile_logs;"
133133
echo "The '${RESTORE_DATABASE}.profile_history' table has been successfully restored"
134134

135-
echo "Processing completed"
135+
echo "Processing completed"

src/query/service/tests/it/storages/fuse/operations/mutation/segments_compact_mutator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ impl CompactSegmentTestFixture {
781781
None,
782782
None,
783783
None,
784-
None,
784+
None,
785785
Compression::Lz4Raw,
786786
Some(Utc::now()),
787787
);

0 commit comments

Comments
 (0)