Commit 8174190
authored
Optimize
[SC-53188](https://app.shortcut.com/tiledb-inc/story/53188/azure-update-touch-to-use-conditional-requests)
[SC-53189](https://app.shortcut.com/tiledb-inc/story/53189/gcs-update-touch-to-use-conditional-requests)
[SC-54494](https://app.shortcut.com/tiledb-inc/story/54494/win-touch-is-prone-to-race-conditions)
This PR updates the implementations of `VFS::touch` for Azure, GCS and
Windows to improve performance and fix race conditions:
* On Azure we remove checking if the blob exists, and instead use a
single [conditional
request](https://learn.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations)
to upload an empty blob if it does not already exist. This reduces
round-trips and fixes race conditions if the blob was created between
the existence check and the upload.
* GCS did not even have an existence check, which means that the
behavior of `touch` was incorrect and always overwrote the file. This
was fixed by adding a [request
precondition](https://cloud.google.com/storage/docs/request-preconditions).
* On Windows the existence check was removed. We were already doing the
right thing and opened the file with `CREATE_NEW`, but did not mask
failures with `ERROR_FILE_EXISTS` status code. We fix this.
Additionally, the documentation of `tiledb_vfs_touch` was updated to
mention that the file is created only if it does not exist, matching
existing behavior in most VFS implmentations, and the expectations from
the `touch` command.
Testing coverage was added.
---
TYPE: BUG
DESC: Fixed `tiledb_vfs_touch` to not overwrite existing files on GCS.
---
TYPE: BUG
DESC: Fixed `tiledb_vfs_touch` to not overwrite existing files or fail
on Azure and Windows respectively, under race conditions.
---
TYPE: C_API
DESC: Update documentation of `tiledb_vfs_touch` to specify that
existing files are not overwritten, matching the current behavior.VFS::touch and fix defects and race conditions. (#5285)1 parent 6c2363b commit 8174190
File tree
6 files changed
+37
-12
lines changed- test/src
- tiledb
- api/c_api/vfs
- sm
- cpp_api
- filesystem
6 files changed
+37
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
622 | 628 | | |
623 | 629 | | |
624 | 630 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
640 | 640 | | |
641 | 641 | | |
642 | 642 | | |
643 | | - | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
644 | 646 | | |
645 | 647 | | |
646 | 648 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
519 | 519 | | |
520 | 520 | | |
521 | 521 | | |
522 | | - | |
| 522 | + | |
| 523 | + | |
523 | 524 | | |
524 | 525 | | |
525 | 526 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
730 | 730 | | |
731 | 731 | | |
732 | 732 | | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | 733 | | |
737 | 734 | | |
738 | 735 | | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
739 | 741 | | |
740 | 742 | | |
741 | | - | |
| 743 | + | |
742 | 744 | | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
743 | 749 | | |
744 | 750 | | |
745 | 751 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
741 | 741 | | |
742 | 742 | | |
743 | 743 | | |
744 | | - | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
745 | 752 | | |
746 | 753 | | |
747 | | - | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
748 | 758 | | |
749 | 759 | | |
750 | 760 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | 164 | | |
169 | 165 | | |
170 | 166 | | |
| |||
180 | 176 | | |
181 | 177 | | |
182 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| |||
0 commit comments