You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/usage.rst
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,8 @@ Additional optional arguments:
56
56
than MAXSIZE except when individual input files exceed MAXSIZE (as
57
57
individual files are never split up between different tar files).
58
58
* ``--non-blocking`` Zstash will submit a Globus transfer and immediately create a subsequent tarball. That is, Zstash will not wait until the transfer completes to start creating a subsequent tarball. On machines where it takes more time to create a tarball than transfer it, each Globus transfer will have one file. On machines where it takes less time to create a tarball than transfer it, the first transfer will have one file, but the number of tarballs in subsequent transfers will grow finding dynamically the most optimal number of tarballs per transfer. NOTE: zstash is currently always non-blocking.
59
+
* ``--error-on-duplicate-tar`` Raise an error if a tar file with the same name already exists in the database. If this flag is set, zstash will exit if it sees a duplicate tar. If it is not set, zstash's behavior will depend on whether or not the --overwrite-duplicate-tar flag is set.
60
+
* ``--overwrite-duplicate-tars`` If a duplicate tar is encountered, overwrite the existing tar file with the new one (i.e., it will assume the latest tar is the correct one). If this flag is not set, zstash will permit multiple entries for the same tar in its database.
59
61
* ``-v`` increases output verbosity.
60
62
61
63
Local tar files as well as the sqlite3 index database (index.db) will be stored
@@ -153,6 +155,7 @@ where
153
155
an incomplete tar file, then the archive you're checking
154
156
must have been created using ``zstash >= v1.1.0``.
155
157
* ``--tars`` to specify specific tars to check. See below for example usage.
158
+
* ``--error-on-duplicate-tar`` Raise an error if a tar file with the same name already exists in the database. If this flag is set, zstash will exit if it sees a duplicate tar. If it is not set, zstash will check if the sizes and md5sums match *at least one* of the tars.
156
159
* ``-v`` increases output verbosity.
157
160
* ``[files]`` is a list of files to check (standard wildcards supported).
158
161
@@ -240,6 +243,8 @@ where
240
243
they have been extracted from the archive. Normally, they are deleted after
241
244
successful transfer.
242
245
* ``--non-blocking`` Zstash will submit a Globus transfer and immediately create a subsequent tarball. That is, Zstash will not wait until the transfer completes to start creating a subsequent tarball. On machines where it takes more time to create a tarball than transfer it, each Globus transfer will have one file. On machines where it takes less time to create a tarball than transfer it, the first transfer will have one file, but the number of tarballs in subsequent transfers will grow finding dynamically the most optimal number of tarballs per transfer. NOTE: zstash is currently always non-blocking.
246
+
* ``--error-on-duplicate-tar`` Raise an error if a tar file with the same name already exists in the database. If this flag is set, zstash will exit if it sees a duplicate tar. If it is not set, zstash's behavior will depend on whether or not the --overwrite-duplicate-tar flag is set.
247
+
* ``--overwrite-duplicate-tars`` If a duplicate tar is encountered, overwrite the existing tar file with the new one (i.e., it will assume the latest tar is the correct one). If this flag is not set, zstash will permit multiple entries for the same tar in its database.
243
248
* ``-v`` increases output verbosity.
244
249
245
250
Note: in the event that an update includes revisions to files previously archived, ``zstash update``
@@ -319,6 +324,7 @@ where
319
324
an incomplete tar file, then the archive you're extracting from
320
325
must have been created using ``zstash >= v1.1.0``.
321
326
* ``--tars`` to specify specific tars to extract. See "Check" above for example usage.
327
+
* ``--error-on-duplicate-tar`` Raise an error if a tar file with the same name already exists in the database. If this flag is set, zstash will exit if it sees a duplicate tar. If it is not set, zstash will check if the sizes and md5sums match *at least one* of the tars.
322
328
* ``-v`` increases output verbosity.
323
329
* ``[files]`` is a list of files to be extracted (standard wildcards supported).
Copy file name to clipboardExpand all lines: tests/scripts/database_corruption.bash
+12-7Lines changed: 12 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,4 @@
1
-
# TODO: Commit these changes
2
-
# TODO: Factor out functions in this script
3
-
# TODO: Run the unit tests too
4
-
# TODO: Add any functionality added to create to update as well.
5
-
# TODO: Add any new parameters to the usage docs
1
+
# TODO: Run the unit tests on Perlmutter
6
2
7
3
setup()
8
4
{
@@ -58,6 +54,15 @@ run_test_cases()
58
54
fail_count=0
59
55
review_str=""
60
56
57
+
# Test case explanations ##################################################
58
+
# 1.`zstash create`, then run `zstash_check` from a different directory.
59
+
# 2. `zstash create`, then run `zstash_check` from a directory that already has `zstash/index.db`.
60
+
# 3. `zstash_create` with `--for-developers-force-database-corruption="simulate_row_existing" --error-on-duplicate-tar`. Errors out on create, so we don't even get to check.
61
+
# 4. `zstash create` with `--for-developers-force-database-corruption="simulate_row_existing_bad_size" --overwrite-duplicate-tars`. We see there's a duplicate tar and we overwrite it with the latest data. `zstash check` confirms the tar is correct.
62
+
# 5. `zstash create` with `--for-developers-force-database-corruption="simulate_row_existing"`. We simply add a duplicate tar, but `zstash check` with `--error-on-duplicate-tar` errors out because it finds two entries for the same tar.
63
+
# 6. `zstash create` with `--for-developers-force-database-corruption="simulate_no_correct_size"` to construct a very bad database: two entries for the same tar, both with incorrect sizes. `zstash check` confirms that no entries match the actual file size.
64
+
# 7. `zstash create` with `--for-developers-force-database-corruption="simulate_row_existing_bad_size"`. We add a duplicate tar, but with the wrong size. `zstash check` confirms that the other entry matches the actual file size, so it succeeds.
65
+
61
66
# Standard cases ##########################################################
62
67
63
68
@@ -98,12 +103,12 @@ run_test_cases()
98
103
else
99
104
((success_count++))
100
105
fi
101
-
# Do NOT change directory
106
+
cd zstash_demo # Use a directory that already has a zstash/index.db!
102
107
zstash check --hpss=${DST_DIR}/${case_name}2>&1| tee check.log
103
108
grep "INFO: 000000.tar: Found a single database entry." check.log
104
109
if [ $?!= 0 ];then
105
110
((fail_count++))
106
-
review_str+="${case_name}_check/check.log,"
111
+
review_str+="${case_name}_create/zstash_demo/check.log,"# Notice this is a different path!
help="do not wait for each Globus transfer until it completes.",
107
107
)
108
+
optional.add_argument(
109
+
"--error-on-duplicate-tar",
110
+
action="store_true",
111
+
help="Raise an error if a tar file with the same name already exists in the database. If this flag is set, zstash will exit if it sees a duplicate tar. If it is not set, zstash's behavior will depend on whether or not the --overwrite-duplicate-tar flag is set.",
112
+
)
113
+
optional.add_argument(
114
+
"--overwrite-duplicate-tars",
115
+
action="store_true",
116
+
help="If a duplicate tar is encountered, overwrite the existing tar file with the new one (i.e., it will assume the latest tar is the correct one). If this flag is not set, zstash will permit multiple entries for the same tar in its database.",
0 commit comments