Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
haf_api_node
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
haf_api_node
Commits
dd425e79
Commit
dd425e79
authored
4 months ago
by
Dan Notestein
Browse files
Options
Downloads
Patches
Plain Diff
create_zfs_dataset creates an empty snapshot, snapshot_zfs_datasets checks if...
parent
8293bd07
No related branches found
No related tags found
2 merge requests
!66
Merge develop to master for release
,
!50
create_zfs_dataset creates an empty snapshot, snapshot_zfs_datasets checks if...
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
create_zfs_datasets.sh
+3
-0
3 additions, 0 deletions
create_zfs_datasets.sh
snapshot_zfs_datasets.sh
+27
-0
27 additions, 0 deletions
snapshot_zfs_datasets.sh
with
30 additions
and
0 deletions
create_zfs_datasets.sh
+
3
−
0
View file @
dd425e79
...
...
@@ -133,3 +133,6 @@ mkdir -p "$TOP_LEVEL_DATASET_MOUNTPOINT/logs/caddy"
chown
-R
1000:100
"
$TOP_LEVEL_DATASET_MOUNTPOINT
/logs"
# 105:109 is postgres:postgres inside the container
chown
-R
105:109
"
$TOP_LEVEL_DATASET_MOUNTPOINT
/logs/postgresql"
"
$TOP_LEVEL_DATASET_MOUNTPOINT
/logs/pgbadger"
# Create a snapshot called 'empty'
./snapshot_zfs_datasets.sh empty
This diff is collapsed.
Click to expand it.
snapshot_zfs_datasets.sh
+
27
−
0
View file @
dd425e79
...
...
@@ -134,6 +134,33 @@ fi
echo
"All datasets appear unmountable"
if
[
"
$SNAPSHOT_NAME
"
!=
"empty"
]
;
then
if
[
!
-e
"
${
TOP_LEVEL_DATASET_MOUNTPOINT
}
/shared_memory/shared_memory.bin"
]
;
then
echo
"Warning: No shared memory file found in the shared_memory directory"
exit
1
fi
last_shared_memory_write
=
$(
stat
-c
%Y
"
${
TOP_LEVEL_DATASET_MOUNTPOINT
}
/shared_memory/shared_memory.bin"
)
last_blockchain_write
=
$(
find
"
${
TOP_LEVEL_DATASET_MOUNTPOINT
}
/blockchain"
-type
f
-printf
'%T@\n'
|
sort
-n
|
tail
-1
)
if
[
-z
"
$last_blockchain_write
"
]
;
then
echo
"Warning: No files found in the blockchain directory"
exit
1
fi
time_diff
=
$((
last_blockchain_write
-
last_shared_memory_write
))
if
[
$time_diff
-gt
300
]
||
[
$time_diff
-lt
-300
]
;
then
echo
"Warning: The shared_memory.bin file was not written to within 5 minutes of the last write to a file in the blockchain directory."
read
-p
"Do you want to continue? (y/n): "
choice
case
"
$choice
"
in
y|Y
)
echo
"Continuing..."
;;
n|N
)
echo
"Aborting."
;
exit
1
;;
*
)
echo
"Invalid input. Aborting."
;
exit
1
;;
esac
fi
fi
if
[
$PUBLIC_SNAPSHOT
-eq
1
]
;
then
stdbuf
-o0
echo
""
stdbuf
-o0
echo
"Moving log files out of the dataset because this is a public snapshot... "
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment