Skip to content

Conversation

@swamirishi
Copy link
Contributor

@swamirishi swamirishi commented Mar 23, 2023

What changes were proposed in this pull request?

Currently s3Gateway fails to come up if "ozone.http.basedir" is not defined.

What is the link to the Apache JIRA

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

How was this patch tested?

Manually tested.

@kerneltime
Copy link
Contributor

I took a deeper look into this, this was due to the change in #4308 which impacts S3G as S3 G does configure a webui that displays some basic AWS CLI usage. One option could be to set the temporary folder to be relative to the current working directory for S3G. The main issue that is being avoided in #4308 is the cleanup of the landing page content due to clean up of /tmp folder.

// fail.
Path tmpMetaDir = Files.createTempDirectory(Paths.get(""),
"ozone_s3g_tmp_meta_dir");
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use ShutdownHookManager to add the shutdown hook. Also, I think it should be executed after the other hook (which stops the server), so use a lower than default priority.

Copy link
Contributor

Choose a reason for hiding this comment

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

@swamirishi do you plan to address this? Also, we can change this PR to change the logic for all the webUIs to see the $CWD.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kerneltime Should I do the web ui change as part of another PR?

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

On second look I think it would be better to set OzoneConfigKeys.OZONE_HTTP_BASEDIR instead of OZONE_METADATA_DIRS, which is only a fallback.

String baseDir = conf.get(OzoneConfigKeys.OZONE_HTTP_BASEDIR);
if (StringUtils.isEmpty(baseDir)) {
baseDir = getOzoneMetaDirPath(conf) + SERVER_DIR;
}
createDir(baseDir);
httpServer.getWebAppContext().setAttribute(JETTY_BASETMPDIR, baseDir);

@adoroszlai
Copy link
Contributor

Thanks @swamirishi for updating the patch to set OZONE_HTTP_BASEDIR. I think you missed the other two comments:

#4455 (comment)
#4455 (comment)

if (StringUtils.isEmpty(ozoneConfiguration.get(
OzoneConfigKeys.OZONE_HTTP_BASEDIR))) {
//Setting ozone.metadata.dirs if not set so that server setup doesn't
// fail.
Copy link
Contributor

Choose a reason for hiding this comment

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

Update comment, setting to tmp directory from current working directory, cwd.

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

@neils-dev
Copy link
Contributor

Thanks @swamirishi . Following up on this, just have the minor comment regarding fixing the comment in the code to set to current working dir if not set. Also, the CI workflow has errors in the integration tests, re-run to see if resolves.

@adoroszlai
Copy link
Contributor

CI workflow has errors in the integration tests, re-run to see if resolves

Since there are changes requested outstanding, CI does not need to be re-run with the current state of the PR.

@adoroszlai
Copy link
Contributor

/pending extract method, use ShutdownHookManager

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Marking this issue as un-mergeable as requested.

Please use /ready comment when it's resolved.

Please note that the PR will be closed after 21 days of inactivity from now. (But can be re-opened anytime later...)

extract method, use ShutdownHookManager

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Thanks @swamirishi for updating the patch. I think it's getting close to completion, but there is a checkstyle failure.

@adoroszlai
Copy link
Contributor

Thanks @swamirishi for the updates. Latest commit introduced another checkstyle failure:

hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/Gateway.java
 23: Unused import - java.nio.file.Path.

(Hint: it can be run locally simply by hadoop-ozone/dev-support/checks/checkstyle.sh.)

@adoroszlai
Copy link
Contributor

/ready

@github-actions github-actions bot dismissed their stale review April 18, 2023 07:25

Blocking review request is removed.

@github-actions github-actions bot removed the pending label Apr 18, 2023
@adoroszlai adoroszlai changed the title HDDS-8253. Set ozone.metadata.dirs if not defined to tmp dir for s3Gateway HDDS-8253. Set ozone.metadata.dirs to temporary dir if not defined in S3 Gateway Apr 18, 2023
@adoroszlai adoroszlai merged commit dd489c7 into apache:master Apr 18, 2023
@adoroszlai
Copy link
Contributor

Thanks @swamirishi for the patch, @kerneltime, @neils-dev, @sadanand48 for the review.

errose28 added a commit to errose28/ozone that referenced this pull request Apr 20, 2023
* master: (440 commits)
  HDDS-8445. Move PlacementPolicy back to SCM (apache#4588)
  HDDS-8335. ReplicationManager: EC Mis and Under replication handlers should handle overloaded exceptions (apache#4593)
  HDDS-8355. Intermittent failure in TestOMRatisSnapshots#testInstallSnapshot (apache#4592)
  HDDS-8444. Increase timeout of CI build (apache#4586)
  HDDS-8446. Selective checks: handle change in ci.yaml (apache#4587)
  HDDS-8440. Ozone Manager crashed with ClassCastException when deleting FSO bucket. (apache#4582)
  HDDS-7309. Enable by default GRPC between S3G and OM (apache#3820)
  HDDS-8458. Mark TestBlockDeletion#testBlockDeletion as flaky
  HDDS-8385. Ozone can't process snapshot when service UID > 2097151 (apache#4580)
  HDDS-8424: Preserve legacy bucket getKeyInfo behavior (apache#4576)
  HDDS-8453. Mark TestDirectoryDeletingServiceWithFSO#testDirDeletedTableCleanUpForSnapshot as flaky
  HDDS-8137. [Snapshot] SnapDiff to use tombstone entries in SST files (apache#4376)
  HDDS-8270. Measure checkAccess latency for Ozone objects (apache#4467)
  HDDS-8109. Seperate Ratis and EC MisReplication Handling (apache#4577)
  HDDS-8429. Checkpoint is not closed properly in OMDBCheckpointServlet (apache#4575)
  HDDS-8253. Set ozone.metadata.dirs to temporary dir if not defined in S3 Gateway (apache#4455)
  HDDS-8400. Expose rocksdb last sequence number through metrics (apache#4557)
  HDDS-8333. ReplicationManager: Allow partial EC reconstruction if insufficient nodes available (apache#4579)
  HDDS-8147. Introduce latency metrics for S3 Gateway operations (apache#4383)
  HDDS-7908. Support OM Metadata operation Generator in `Ozone freon` (apache#4251)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants