Skip to content

[FileCopy based bootstrap][FileCopyHandler] Add FCHandler#3035

Merged
DevenAhluwalia merged 26 commits intomasterfrom
dw-filecopy-handler
Mar 24, 2025
Merged

[FileCopy based bootstrap][FileCopyHandler] Add FCHandler#3035
DevenAhluwalia merged 26 commits intomasterfrom
dw-filecopy-handler

Conversation

@DevenAhluwalia
Copy link
Contributor

@DevenAhluwalia DevenAhluwalia commented Mar 11, 2025

Summary

BUG=AMBRY-13117

Adds support for FileCopyHandler that orchestrates GetMetadata and GetChunk Apis given a Replica and a target peer node.

Testing Done

Test suite WIP

@DevenAhluwalia DevenAhluwalia self-assigned this Mar 11, 2025
@DevenAhluwalia DevenAhluwalia marked this pull request as ready for review March 12, 2025 06:28
/**
* Configuration for FileCopyHandler
*/
public class FileCopyHandlerConfig {
Copy link
Contributor

@aga9900 aga9900 Mar 17, 2025

Choose a reason for hiding this comment

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

Should we merge it to File Copy Based Replication Config. Creating separate config classes. will require too many config object to be sent from upstream classes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Imo, FCHConfig makes sense to exist on its own considering that more configs will come in later once Throttling piece is in the picture.
Currently preferring to not merge.

@Nonnull ConnectionPool connectionPool,
@Nonnull StoreManager storeManager,
@Nonnull ClusterMap clusterMap,
@Nonnull FileCopyHandlerConfig config) {
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 use File Copy config instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above. Currently preferring to not merge FCHConfig with FCBasedReplicationConfig.

* Shutdown the file copy handler. Perform clean up steps in case of a graceful shutdown.
*/
void shutdown() {
connectionPool.shutdown();
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we planning to create a seperate connection pool for File Copy. We should not close it in File Copy Handler if this is a shared connection pool.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

imo, there's stop() method for stopping FCH and not closing connPool while shutdown is essentially to be called when the AmbryProcess is shutting down.

public void testGetFileCopyGetMetaDataResponseExpectConnectionTimeout() throws Exception {
// Arrange: Mock ConnectionPoolTimeoutException
when(handler.getOperationRetryHandler().executeWithRetry(any(), eq(GetMetadataWorkflow.GET_METADATA_OPERATION_NAME)))
.thenThrow(new ConnectionPoolTimeoutException("Timeout"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to override the default timeout set for Connection Pool for File Copy or make it configurable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already defined in fileCopyHandlerConnectionTimeoutMs in FCHConfig. Currently set to 5 seconds.

We'll need to tweak it to bigger values depending on chunk size. Also, this may be dynamic connection-timeout value for different operations (GetMetadata is still 5s meanwhile GetChunkData is like 30s etc).
These changes'll come in later once we are testing different chunk sizes.

Copy link
Contributor

@aga9900 aga9900 left a comment

Choose a reason for hiding this comment

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

Left Comments

Copy link
Contributor

@manbearpig1996 manbearpig1996 left a comment

Choose a reason for hiding this comment

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

GTG

Copy link
Contributor

@aga9900 aga9900 left a comment

Choose a reason for hiding this comment

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

LGTM

@DevenAhluwalia DevenAhluwalia merged commit b9195d7 into master Mar 24, 2025
5 checks passed
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.

3 participants