Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 10.17.0 #2029

Merged
merged 76 commits into from
Jan 23, 2023
Merged
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
ad503c1
Add mitigation for weird NtQuerySecurityObject behavior on NAS source…
adreed-msft Aug 31, 2022
314e041
Fix bad URL delete (#1892)
adreed-msft Sep 8, 2022
1b53a7b
Update MacOS testing pipeline (#1896)
adreed-msft Sep 19, 2022
13ef5e3
fixing small typo (,) in help of jobs clean (#1899)
mstenz Sep 22, 2022
46e205e
Implement MD OAuth testing (#1859)
adreed-msft Oct 3, 2022
a219955
Add "all" to documentation (#1902)
adreed-msft Oct 4, 2022
ec0a2e9
10.16.1 patch notes (#1913)
adreed-msft Oct 4, 2022
1aa28fe
Correct version
adreed-msft Oct 5, 2022
bea738d
Export Successfully Updated bytes (#1884)
nakulkar-msft Oct 10, 2022
65af689
Add info in error message for mkdir on Log/Plan (#1883)
ksaur Oct 10, 2022
e4f1c3e
Fix fixupTokenJson (#1890)
adam-orosz Oct 10, 2022
355ea4b
Do not log request/response for container creation error (#1893)
nakulkar-msft Oct 10, 2022
edeb82b
Expose AZCOPY_DOWNLOAD_TO_TEMP_PATH environment variable. (#1895)
adreed-msft Oct 10, 2022
8539454
Slice against the correct string (#1927)
adreed-msft Oct 24, 2022
fda0c83
UX improvement: avoid crash when copying S2S with user delegation SAS…
zezha-msft Oct 27, 2022
e73d0a2
Fix bad build + Prevent bad builds in the future (#1917)
adreed-msft Oct 27, 2022
c6f9c8c
Make sync use last write time for Azure Files (#1930)
adreed-msft Nov 3, 2022
616568d
10.16.2 Changelog (#1948)
adreed-msft Nov 3, 2022
0eacc61
Update azcopy version
adreed-msft Nov 3, 2022
cfca47d
Merge branch 'main' into dev
adreed-msft Nov 3, 2022
090d2d8
Fixed a bug where preserve permissions would not work with OAuth
gapra-msft Nov 15, 2022
945b8a1
Added CODEOWNERS file
gapra-msft Nov 16, 2022
03e02c5
Fixed issue where CPK would not be injected on retries
gapra-msft Nov 16, 2022
f92b840
Added CODEOWNERS file
gapra-msft Nov 16, 2022
21bea31
remove OAuth from test
gapra-msft Nov 16, 2022
f3ef735
Fixed issue where CPK would not be injected on retries
gapra-msft Nov 17, 2022
e6c1b7a
Merge pull request #1963 from Azure/gapra/getACLOAuth
gapra-msft Nov 21, 2022
1e8fc79
Updated version check string to indicate current AzCopy version (#1969)
gapra-msft Nov 21, 2022
bf3a84c
added codeowner
tasherif-msft Dec 1, 2022
ffbeb92
Enhance job summary with details about file/folders (#1952)
adreed-msft Dec 1, 2022
e653f23
Add flag to disable version check (#1950)
adreed-msft Dec 1, 2022
9d57431
Merge pull request #1980 from Azure/tasherif-codeowner
tasherif-msft Dec 1, 2022
3d8d0e1
darwin arm64
tasherif-msft Dec 3, 2022
d7c9d3a
Update golang version to 10.19.2 (#1925)
nakulkar-msft Dec 6, 2022
8f3f8f7
enable cgo
tasherif-msft Dec 6, 2022
73e8b32
added tests
tasherif-msft Dec 6, 2022
4557448
Minor fixes: More in description (#1968)
nakulkar-msft Dec 7, 2022
fcb87a5
azcopy fail to copy 12TB file to Storage containers in Dev.
reshmav18 Dec 20, 2022
fc51bde
Added extra logging when switching endpoints
tasherif-msft Dec 21, 2022
3d222a3
Enable support for preserving SMB info on Linux. (#1723)
linuxsmiths Dec 22, 2022
23a0a77
Added log indicating a sub-directory is being enqueued (#1999)
gapra-msft Dec 22, 2022
4ca0b60
Merge pull request #2002 from Azure/hns-logging
tasherif-msft Dec 22, 2022
8f0103b
Merge pull request #1997 from reshmav18/patch-3
tasherif-msft Dec 22, 2022
30958f8
Log sync deletions to scanning logger (#2000)
nakulkar-msft Dec 23, 2022
aecb217
ieproxy fix
tasherif-msft Jan 5, 2023
83b9a2a
Merge branch 'ieproxy-fix' into test-cross-comp
tasherif-msft Jan 5, 2023
411b5ec
remove cgo
tasherif-msft Jan 5, 2023
0fac383
fix
tasherif-msft Jan 5, 2023
8514d39
fix
tasherif-msft Jan 5, 2023
0960514
fix
tasherif-msft Jan 5, 2023
64ea538
more testing
tasherif-msft Jan 5, 2023
d239be8
more testing
tasherif-msft Jan 5, 2023
55de682
more testing
tasherif-msft Jan 5, 2023
b780635
more testing
tasherif-msft Jan 5, 2023
da6fde1
Merge branch 'dev' into test-cross-comp
tasherif-msft Jan 5, 2023
b923a3a
mod tidy
tasherif-msft Jan 5, 2023
98b4356
mod tidy
tasherif-msft Jan 5, 2023
db2e8b1
more testing
tasherif-msft Jan 5, 2023
b1139c2
Added codespell (#2008)
gapra-msft Jan 5, 2023
62ef70d
Added CodeQL (#2009)
gapra-msft Jan 6, 2023
5883086
Fix for rare infinite loop on mutex acquisition (#2012)
gapra-msft Jan 6, 2023
cd6b989
small fix
tasherif-msft Jan 8, 2023
cebc33f
Merge branch 'test-cross-comp' of github.com:Azure/azure-storage-azco…
tasherif-msft Jan 8, 2023
c824ad3
removed test
tasherif-msft Jan 8, 2023
2d15a37
Merge pull request #1983 from Azure/test-cross-comp
tasherif-msft Jan 9, 2023
052b801
Added trivy file (#2015)
gapra-msft Jan 9, 2023
e376658
Improve debug-ability of e2e tests by uploading logs of failed jobs (…
adreed-msft Jan 12, 2023
708a138
Fail copy job if single blob does not exist (#1981)
tasherif-msft Jan 12, 2023
0f466d5
Correct odd behavior around folder overwrites (#1961)
adreed-msft Jan 12, 2023
60c9aed
Fix files sync by determining which LMT to use via smb properties fla…
adreed-msft Jan 19, 2023
b023fc5
Fix metadata parsing (#1953)
adreed-msft Jan 19, 2023
4779674
Fix ADLSG2 intermittent failure (#1901)
adreed-msft Jan 20, 2023
16ca699
Store source token and pass to other threads (#1996)
tasherif-msft Jan 20, 2023
db0033d
Hash based sync (#2020)
adreed-msft Jan 20, 2023
e8e6233
Copy properties from Source (#1964)
nakulkar-msft Jan 21, 2023
30dfab5
Release notes and version update (#2028)
nakulkar-msft Jan 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix bad URL delete (#1892)
* Manipulate URLs safely

* Fix folder deletion test

* Prevent infinite loop upon listing failure

* Fix GCP error checking

* Fix GCP disable

* Fail when errors listing/clearing bucket
  • Loading branch information
adreed-msft authored Sep 8, 2022
commit 314e04192cb3cf29769c618cc395a015162f4c63
6 changes: 4 additions & 2 deletions cmd/zt_test.go
Original file line number Diff line number Diff line change
@@ -600,13 +600,15 @@ func deleteGCPBucket(c *chk.C, client *gcpUtils.Client, bucketName string, waitQ
break
}

c.Log("Failed to clear GCS bucket:", err) // todo: maybe this code should be more resilient
// Failure during listing
c.Assert(err, chk.Equals, nil)
return
}
if err == nil {
err = bucket.Object(attrs.Name).Delete(nil)
if err != nil {
c.Log("Could not clear GCS Buckets:", err) // todo: maybe this code should be more resilient
// Failure cleaning bucket
c.Assert(err, chk.Equals, nil)
return
}
}
64 changes: 38 additions & 26 deletions common/folderDeletionManager.go
Original file line number Diff line number Diff line change
@@ -103,35 +103,51 @@ type standardFolderDeletionManager struct {
ctx context.Context
}

func (s *standardFolderDeletionManager) clean(u *url.URL) string {
sasless := strings.Split(u.String(), "?")[0] // first ?, if it exists, is always start of query
cleaned, err := url.PathUnescape(sasless)
if err != nil {
panic("uncleanable url") // should never happen
func (s standardFolderDeletionManager) copyURL(u *url.URL) *url.URL {
out := *u
if u.User != nil {
user := *u.User
out.User = &user
}
return cleaned

return &out
}

func (s *standardFolderDeletionManager) clean(u *url.URL) *url.URL {
out := s.copyURL(u)
out.RawQuery = "" // no SAS

return out
}

// getParent drops final part of path (not using use path.Dir because it messes with the // in URLs)
func (s *standardFolderDeletionManager) getParent(u *url.URL) (string, bool) {
if len(u.Path) == 0 {
return "", false // path is already empty, so we can't go up another level
func (s *standardFolderDeletionManager) getParent(u *url.URL) (*url.URL, bool) {
if len(u.Path) == 0 || u.Path == "/" {
return u, false // path is already empty, so we can't go up another level
}

// trim off last portion of path (or all of the path, if it only has one component)
c := s.clean(u)
lastSlash := strings.LastIndex(c, "/")
return c[0:lastSlash], true
out := s.clean(u)
out.Path = out.Path[:strings.LastIndex(out.Path, "/")]
if out.RawPath != "" {
out.RawPath = out.Path[:strings.LastIndex(out.RawPath, "/")]
}
return out, true
}

func (s standardFolderDeletionManager) getMapKey(u *url.URL) string {
return url.PathEscape(u.Path)
}

// getStateAlreadyLocked assumes the lock is already held
func (s *standardFolderDeletionManager) getStateAlreadyLocked(folder string) *folderDeletionState {
state, alreadyKnown := s.contents[folder]
func (s *standardFolderDeletionManager) getStateAlreadyLocked(folder *url.URL) *folderDeletionState {
fmapKey := s.getMapKey(folder)
state, alreadyKnown := s.contents[fmapKey]
if alreadyKnown {
return state
} else {
state = &folderDeletionState{}
s.contents[folder] = state
s.contents[fmapKey] = state
return state
}
}
@@ -155,7 +171,7 @@ func (s *standardFolderDeletionManager) RecordChildDeleted(childFile *url.URL) {
}

s.mu.Lock()
folderStatePtr, alreadyKnown := s.contents[folder]
folderStatePtr, alreadyKnown := s.contents[s.getMapKey(folder)]
if !alreadyKnown {
// we are not tracking this child, so there is nothing that we should do in response
// to its deletion (may happen in the recursive calls from tryDeletion, when they recurse up to parent dirs)
@@ -177,33 +193,29 @@ func (s *standardFolderDeletionManager) RecordChildDeleted(childFile *url.URL) {
}

func (s *standardFolderDeletionManager) RequestDeletion(folder *url.URL, deletionFunc FolderDeletionFunc) {
folderStr := s.clean(folder)
folder = s.clean(folder)

s.mu.Lock()
folderStatePtr := s.getStateAlreadyLocked(folderStr)
folderStatePtr := s.getStateAlreadyLocked(folder)
folderStatePtr.deleter = deletionFunc
shouldDel := folderStatePtr.shouldDeleteNow() // test now in case there are no children
s.mu.Unlock() // release lock before expensive deletion attempt

if shouldDel {
s.tryDeletion(folderStr, deletionFunc)
s.tryDeletion(folder, deletionFunc)
}
}

func (s *standardFolderDeletionManager) tryDeletion(folder string, deletionFunc FolderDeletionFunc) {
func (s *standardFolderDeletionManager) tryDeletion(folder *url.URL, deletionFunc FolderDeletionFunc) {
success := deletionFunc(s.ctx, s.logger) // for safety, deletionFunc should be coded to do nothing, and return false, if the directory is not empty

if success {
s.mu.Lock()
delete(s.contents, folder)
delete(s.contents, s.getMapKey(folder))
s.mu.Unlock()

// folder is, itself, a child of its parent. So recurse. This is the only place that RecordChildDeleted should be called with a FOLDER parameter
u, err := url.Parse(folder)
if err != nil {
panic("folder url not parsable") // should never happen, because we started with a URL
}
s.RecordChildDeleted(u)
s.RecordChildDeleted(folder)
}
}

2 changes: 1 addition & 1 deletion common/zt_folderDeletionManager_test.go
Original file line number Diff line number Diff line change
@@ -167,7 +167,7 @@ func (s *folderDeletionManagerSuite) TestGetParent(c *chk.C) {
c.Assert(ok, chk.Equals, false)
} else {
c.Assert(ok, chk.Equals, true)
c.Assert(p, chk.Equals, expectedParent)
c.Assert(p.String(), chk.Equals, expectedParent)
}
}