-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HADOOP-16697. Tune/audit S3A authoritative mode #1707
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
HADOOP-16697. Tune/audit S3A authoritative mode #1707
Conversation
tests need to unset auth mode dirs from per bucket settings, else ITestAuthoritativePath can fail
|
94858b3
to
aeb09b3
Compare
going to add a S3GuardInstrumentation interface so the internals of the S3A FS aren't so exposed in the S3Guard API. This also lets us assume that the instrumentation is never null, which simplifies code |
9a951fa
to
397a754
Compare
|
For anyone watching, the latest PR has testRenameWithNonEmptySubDir failing as a dest path appears to exist. No idea why, yet: debug time. Related to that -the S3A contract rename tests are parameterized on auth/non-auth; the non-auth ones skip if !s3guard. It might make sense to do that for more of the tests to better guarantee coverage of the two modes of operation. |
4db6bd5
to
f60da56
Compare
testing s3a ireland with & without auth. doing a local db test run too for completeness |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @steveloughran for this major piece of work.
It would be also great if we could split this into different chunks - adding the new auth tool, metrics, prune, rebasing the import under different jiras, but it's ok to do that if we don't forget to add every new feature and fix to the description so we will remember later.
Added some comments about the code in my first review phase.
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java
Outdated
Show resolved
Hide resolved
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AFileSystem.java
Outdated
Show resolved
Hide resolved
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/S3AInstrumentation.java
Outdated
Show resolved
Hide resolved
...p-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DynamoDBMetadataStore.java
Outdated
Show resolved
Hide resolved
...p-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DynamoDBMetadataStore.java
Outdated
Show resolved
Hide resolved
...p-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DynamoDBMetadataStore.java
Outdated
Show resolved
Hide resolved
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/ImportOperation.java
Outdated
Show resolved
Hide resolved
...ools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/MetastoreInstrumentation.java
Outdated
Show resolved
Hide resolved
...doop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/PathMetadataDynamoDBTranslation.java
Outdated
Show resolved
Hide resolved
.../test/java/org/apache/hadoop/fs/s3a/s3guard/ITestDynamoDBMetadataStoreAuthoritativeMode.java
Outdated
Show resolved
Hide resolved
-it also adds a lot on committers and tunes layout Change-Id: I3c048799063a14e1ed13fadc9507c972a9f05259
Change-Id: Ib3313100e335e1a59eaaed631be7c702cb48431c
Change-Id: I7a8a3b36007a99d61b98501e27c231e8a70d970a
This adds a new s3guard command to audit a s3guard bucket's authoritative state: hadoop s3guard authoritative -check-config s3a://landsat-pds Also adds more diags of what is going on, including a specific bulk operation type "listing" which is used for listing initiated updates. No tests or docs, yet. Change-Id: I8949db5315ef005123549079cd73c7567dbc71e8
* new test for ops to verify the operations we expect to mark as auth, those which unmark and those which leave alone do as expected. * prune returns a count of #of pruned entries to enable testing * auditing operation improved for testing Change-Id: Ia8bffe488d819a0d3005ab9eb8b31d2df5203bd9
* prune doesn't clear the auth bit on a dir when a tombstone is deleted underneath. * rename sets all new directories under the dest as authoritative. Also: S3guard instrumentation has an interface and base implementation; metastores always have a non-null value; its used in the S3Guard API calls instead of delving into S3AInstrumentation internals. Note: just realised a problem here: only DDB metastore updates those counters. Never mind. Change-Id: I419757c500eba70c301504de9776e3a353b72ddf
Change-Id: I3c18b376776b83d89caba8cdf6e374bcef5efdd2
This will cause the meta store to marks the directory tree as authoritative once the import has completed its scan. It is off by default because you have to be 100% confident that during a potentially slow scan nobody is writing to that directory tree. This change includes moving the core operations of S3GuardTool.Import into an Importer class for ease of testing and so it can live alongside the auditor. They both use the same (new) MetadataStore method markAuthoritative(path, BulkOperation). For DDB, the AncestorState is used to determine what to mark -we don't attempt any listing of the directory tree. For Local S3Guard, is currently a no-op. I'm not worried about that, Especially as the auditor only audits DDB Tables. The documentation is yet to be updated! Change-Id: Ifc47713d3b70a6bcf2671c7e2ded31a15ee4d9c6
* tests for the CLI, command line parsing etc * tuning CLI based on manual use (mainly logging) S3GuardTool is now closeable, and will close its FS and MS in close. Without this, our tests can leak FS and MS instances. We just hadn't noticed. The CLI entry point of S3GuardTool does the right thing and closes the tool; for our tests we have to explicitly do it. This is done in a mixture of try-with-resources and building up a list of tools to close in test tear down. All tests which patch in an existing metastore need to replace it with a null one before the close operation. Are you Change-Id: I061eb0ece24e84aaffb4f12a3e7c920011146dd6 Testing: new tests are good, doing more regression testing. Can't run -Dlocal for some reason.
f60da56
to
cf10674
Compare
findbugs
|
Change-Id: Id3b4863ddf585f390da95a6c683900c0db690b92
Change-Id: I4d4ca95e990a2b2a3529c38cea9bbb00047e7083
Change-Id: I5a97dee1862162eea0d5f811c70b176b28c67141
checkstyle revision; tested s3 ireland -Dparallel-tests -DtestsThreadCount=8 -Ds3guard -Ddynamo -Dauth no failures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are running ok - one intermittent error with org.apache.hadoop.fs.s3a.s3guard.ITestDynamoDBMetadataStore:
java.lang.IllegalArgumentException: Table THIS_IS_THE_TEST_TABLE is not deleted.
at com.amazonaws.services.dynamodbv2.document.Table.waitForDelete(Table.java:505)
at org.apache.hadoop.fs.s3a.s3guard.ITestDynamoDBMetadataStore.setUp(ITestDynamoDBMetadataStore.java:169)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)```
My review contains some nits to look at, my +1 pending on that.
...p-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/DynamoDBMetadataStore.java
Outdated
Show resolved
Hide resolved
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/ImportOperation.java
Show resolved
Hide resolved
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/s3guard/S3Guard.java
Show resolved
Hide resolved
Based on Gabor's feedback -rename a method -review import logging and extend the -verbose mode already logs each file/dir; now non-verbose and verbose both print summaries of the operation: the number of files and dirs added. Note, well looking at the logging at debug level I can see that after the import, when we mark everything as authoritative, we end up overwriting all the dir entries just added. It's not that easy to avoid doing this while keeping the intermediate state of the S3Guard tables consistent; I'd have to modify that marking operation to do a Get on each dir and only update non-auth ones, while tagging the dirs as auth when created. It's doable; we'd be moving from two writes to one read, one write, or somehow blue together the tracking even more. I'm not convinced it's worth the extra complexity for an operation which is not expected to be run very often. Change-Id: Ic2c6378d4c47fe2dc36d8f6d6b7d5e50735ceacb
…istent store. Essentially, yes -we do need to provide as much diagnostics as we can, which include logging problems at WARN level and are giving a bit more intermediate progress. * renamed `-require-auth` to `-required` so it is easy to remember. * Updated the documentation with a examples of this and expanded import operation. Change-Id: I43051789e105f3cf52e8d8decd61ed7ab6485372
checkstyles Change-Id: I86e515a71174aa91584a5ab9c3fb7a240752c461
oops, deleted last yetus review. I'll kick off a new one. |
(this kicks off a yetus build, which is what I wanted) Change-Id: I6116a86723d3268f1507a7e1654f2a4591b1e72b
💔 -1 overall
This message was automatically generated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are passing (only one intermittent failure of ITestDynamoDBMetadataStore.setUp
is present)
My comments/change requests are all resolved.
+1; Thanks @steveloughran!
Thank you for your excellent diligence going through this patch! |
merged after a final retest |
This adds a new s3guard command to audit a s3guard bucket's authoritative
state:
hadoop s3guard authoritative -check-config s3a://landsat-pds
Also adds more diags of what is going on, including a specific bulk operation type
"listing" which is used for listing initiated updates.
No docs for the new command,
In DDB we do auth mode better, with a new test suite for this.