Skip to content

Conversation

@bharatviswa504
Copy link
Contributor

@bharatviswa504 bharatviswa504 commented Jul 10, 2020

What changes were proposed in this pull request?

Keys created via the S3 Gateway currently use the createKey OM API to create the ozone key. Hence, when using a hdfs client to list intermediate directories in the key, OM returns key not found error. This was encountered while using fluentd to write Hive logs to Ozone via the s3 gateway.

Added a new config in OM to control the behavior of key create to create intermediate directories or not. In this way, keys created via ozone S3G can be accessed through fs API.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-3955

How was this patch tested?

Added UT and IT.

Copy link
Contributor

@arp7 arp7 Jul 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used via FileSystem API (reword comment).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@arp7
Copy link
Contributor

arp7 commented Jul 13, 2020

Can you update the PR template a bit to describe the high-level approach (was fix made in OM or S3G)? 🙂

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make the exception message slightly more descriptive to explain what is really going on. We can mention that createIntermediateDirs behavior is enabled and hence / has special interpretation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@arp7
Copy link
Contributor

arp7 commented Jul 13, 2020

The approach looks really good. It is surprisingly concise and elegant because I was expecting it to be a lot more code! Added a few review comments.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change this to fs.getFileStatus(keypath) so that returns status.isDir() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added test

@bharatviswa504 bharatviswa504 force-pushed the keyput branch 2 times, most recently from bc2ca69 to 51c6a90 Compare July 14, 2020 04:47
@bharatviswa504 bharatviswa504 changed the title Keyput HDDS-3955. Unable to list intermediate paths on keys created using S3G. Jul 14, 2020
@bharatviswa504 bharatviswa504 marked this pull request as ready for review July 15, 2020 00:24
Copy link
Contributor

@avijayanhwx avijayanhwx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @bharatviswa504. Minor comments inline.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rephrase first sentence a bit to state that key names will be interpreted as file system paths. / will be treated as a special character and paths will be normalized and must follow Unix filesystem path naming conventions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leading / in path should be dropped at this point, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This change was required, when we are allowing leading / in keyName. I will revert the change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a little bit worried about changes to OMFileRequest. There is a risk of changing the behavior and invalidating the app-compat testing we have done so far.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change can be reverted as now we don't allow leading / in path names when OMConfig enable.filesystems is set to true. Will updated in my next PR update.

@bharatviswa504
Copy link
Contributor Author

bharatviswa504 commented Jul 16, 2020

Thank You @arp7 and @avijayanhwx for the review.
I have addressed review comments.

This PR only modifies behavior of KeyCreate when ozone.om.enable.filesystem.paths is enabled. (Not changed the default behavior of actual KeyCreate)

@bharatviswa504
Copy link
Contributor Author

Rebased with latest apache main branch.

Copy link
Contributor

@avijayanhwx avijayanhwx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this @bharatviswa504. I have tested the latest version of the patch against a cluster where s3g is writing to OM with ozone.om.enable.filesystem.paths enabled.

@bharatviswa504
Copy link
Contributor Author

Few minor comments, and couple of questions on the expected normalizations.

Overall the change looks good. Thanks for adding comprehensive test cases.

Thank You @arp7 for the review. addressed review comments.

Copy link
Contributor

@arp7 arp7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@arp7 arp7 merged commit 715aed2 into apache:master Jul 18, 2020
errose28 added a commit to errose28/ozone that referenced this pull request Jul 20, 2020
* master:
  HDDS-3984. Support filter and search the columns in recon UI (apache#1218)
  HDDS-3806. Support recognize aws v2 Authorization header. (apache#1098)
  HDDS-3955. Unable to list intermediate paths on keys created using S3G. (apache#1196)
  HDDS-3741. Reload old OM state if Install Snapshot from Leader fails (apache#1129)
  HDDS-3965. SCM failed to start up for duplicated pipeline detected. (apache#1210)
  HDDS-3855. Add upgrade smoketest (apache#1142)
  HDDS-3964. Ratis config key mismatch (apache#1204)
  HDDS-3612. Allow mounting bucket under other volume (apache#1104)
  HDDS-3926. OM Token Identifier table should use in-house serialization. (apache#1182)
  HDDS-3824: OM read requests should make SCM#refreshPipeline outside BUCKET_LOCK (apache#1164)
  HDDS-3966. Disable flaky TestOMRatisSnapshots
errose28 added a commit to errose28/ozone that referenced this pull request Jul 20, 2020
* HDDS-3869:
  HDDS-3984. Support filter and search the columns in recon UI (apache#1218)
  HDDS-3806. Support recognize aws v2 Authorization header. (apache#1098)
  HDDS-3955. Unable to list intermediate paths on keys created using S3G. (apache#1196)
  HDDS-3741. Reload old OM state if Install Snapshot from Leader fails (apache#1129)
  HDDS-3965. SCM failed to start up for duplicated pipeline detected. (apache#1210)
errose28 added a commit to errose28/ozone that referenced this pull request Jul 20, 2020
* master:
  HDDS-3984. Support filter and search the columns in recon UI (apache#1218)
  HDDS-3806. Support recognize aws v2 Authorization header. (apache#1098)
  HDDS-3955. Unable to list intermediate paths on keys created using S3G. (apache#1196)
  HDDS-3741. Reload old OM state if Install Snapshot from Leader fails (apache#1129)
  HDDS-3965. SCM failed to start up for duplicated pipeline detected. (apache#1210)
errose28 pushed a commit to errose28/ozone that referenced this pull request Jul 21, 2020
errose28 added a commit to errose28/ozone that referenced this pull request Jul 21, 2020
* add-deleted-block-table: (63 commits)
  Make block iterator tests use deleted blocks table, and remove the now unused #deleted#
  Replace uses of #deleted# key prefix with access to new deleted blocks table
  Add deleted blocks table to base level DB wrappers
  Have block deleting service test look for #deleted# keys in metadata table
  Move block delete to correct table and remove debugging print statement
  Import schema version when importing container data from export
  HDDS-3984. Support filter and search the columns in recon UI (apache#1218)
  HDDS-3806. Support recognize aws v2 Authorization header. (apache#1098)
  HDDS-3955. Unable to list intermediate paths on keys created using S3G. (apache#1196)
  HDDS-3741. Reload old OM state if Install Snapshot from Leader fails (apache#1129)
  Move new key value block iterator implementation and tests to new interface
  Fix checkstyle violations
  HDDS-3965. SCM failed to start up for duplicated pipeline detected. (apache#1210)
  Update comments
  Add comments on added helper method
  Remove seekToLast() from iterator interface, implementation, and tests
  Add more robust unit test with alternating key matches
  All unit tests pass after allowing keys with deleted and deleting prefixes to be made
  HDDS-3855. Add upgrade smoketest (apache#1142)
  HDDS-3964. Ratis config key mismatch (apache#1204)
  ...
ChenSammi pushed a commit that referenced this pull request Jul 22, 2020
rakeshadr pushed a commit to rakeshadr/hadoop-ozone that referenced this pull request Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants