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

Bootstrap FC optimization: Interfaces for state build and state transition flows #2946

Merged

Conversation

piyujai
Copy link
Contributor

@piyujai piyujai commented Nov 20, 2024

No description provided.

@piyujai piyujai changed the title Base changes for Offline- Base changes for Offline->Bootstrap Nov 20, 2024
@piyujai piyujai changed the title Base changes for Offline->Bootstrap Bootstrap FC optimization: Base changes for Offline->Bootstrap Nov 20, 2024
@piyujai piyujai changed the title Bootstrap FC optimization: Base changes for Offline->Bootstrap [WIP] Bootstrap FC optimization: Base changes for Offline->Bootstrap Nov 20, 2024
@piyujai piyujai force-pushed the bootstrap_state_build_changes branch from b251c8c to 8b13123 Compare November 20, 2024 09:22
@@ -372,6 +372,11 @@ public class ClusterMapConfig {
@Default("false")
public final boolean clusterMapIgnoreDownwardStateTransition;

public static final String ENABLE_FILE_COPY_FOR_BOOTSTRAP = "clustermap.enable.file.copy.for.bootstrap";
@Config(ENABLE_FILE_COPY_FOR_BOOTSTRAP)
@Default("false")
Copy link
Contributor Author

@piyujai piyujai Nov 20, 2024

Choose a reason for hiding this comment

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

Merge into single config

@piyujai piyujai force-pushed the bootstrap_state_build_changes branch 2 times, most recently from d857928 to b4860e8 Compare November 20, 2024 10:27
@piyujai piyujai marked this pull request as draft November 20, 2024 19:45
throw new StateTransitionException(
"Existing Disk manager not found for replica " + partitionName + " is not found in clustermap for " + currentNode, DiskManagerNotFoundForFileCopyStateBuild);
}
diskManager.addBlobStoreToCompactionManager((BlobStore) store);
Copy link
Contributor Author

@piyujai piyujai Nov 21, 2024

Choose a reason for hiding this comment

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

store.start() and diskManager.addBlobStoreToCompactionManager((BlobStore) store) can be moved to file copy manager class later: Justin's suggestion

Choose a reason for hiding this comment

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

Can you elaborate as to why would that be advantageous?

public static final String ENABLE_FILE_COPY_FOR_BOOTSTRAP = "clustermap.enable.file.copy.for.bootstrap";
@Config(ENABLE_FILE_COPY_FOR_BOOTSTRAP)
@Default("false")
public final boolean enableFileCopyForBootstrap;

Choose a reason for hiding this comment

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

Keeping the nomenclature in this file consistent, the name of this key would be
clusterMapEnableFileCopyForBootstrap

@Config(ENABLE_FILE_COPY_FOR_BOOTSTRAP)
@Default("false")
public final boolean enableFileCopyForBootstrap;
public static final String ENABLE_FILE_COPY_FOR_BOOTSTRAP = "clustermap.enable.file.copy.for.bootstrap";

Choose a reason for hiding this comment

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

Either this or the the key defined in ClusterMapConfig needs to be removed.
Further,

  1. Key in this file will have store as prefix
  2. Keeping the nomenclature in this file consistent, the key name would be storeEnableFileCopyForBootstrap

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Noted.

if (!storeConfig.enableFileCopyForBootstrap) {
store.start();
}

// collect store segment requirements and add into DiskSpaceAllocator
List<DiskSpaceRequirements> storeRequirements = Collections.singletonList(store.getDiskSpaceRequirements());

Choose a reason for hiding this comment

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

If store.start() hasn't been invoked, in the normal Replication protocol, would store.getDiskSpaceRequirements() work as expected?

@@ -755,6 +760,8 @@ public void onPartitionBecomeBootstrapFromOffline(String partitionName) {
}
} while (!replicaAdded);


Choose a reason for hiding this comment

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

nit: remove unnecessary new lines.

Choose a reason for hiding this comment

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

Applicable throughout the diff wherever applicable.

throw new StateTransitionException(
"Existing Disk manager not found for replica " + partitionName + " is not found in clustermap for " + currentNode, DiskManagerNotFoundForFileCopyStateBuild);
}
diskManager.addBlobStoreToCompactionManager((BlobStore) store);

Choose a reason for hiding this comment

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

Can you elaborate as to why would that be advantageous?

@DevenAhluwalia
Copy link

This PR needs to be opened with target branch bootstrap-optimisation-lld-flow

@piyujai piyujai force-pushed the bootstrap_state_build_changes branch from 6d54c0e to 08af79a Compare November 26, 2024 09:08
@piyujai piyujai force-pushed the bootstrap_state_build_changes branch from 08af79a to d3ef815 Compare November 26, 2024 09:12
@piyujai piyujai changed the base branch from master to bootstrap-optimisation-lld-flow November 26, 2024 09:13
@piyujai piyujai force-pushed the bootstrap_state_build_changes branch from d3ef815 to b2385bc Compare November 26, 2024 09:17
@piyujai piyujai changed the title [WIP] Bootstrap FC optimization: Base changes for Offline->Bootstrap [WIP] Bootstrap FC optimization: Interfaces for state build Nov 26, 2024
@piyujai piyujai changed the title [WIP] Bootstrap FC optimization: Interfaces for state build [WIP] Bootstrap FC optimization: Interfaces for state build and state transition flows Nov 26, 2024
@piyujai piyujai force-pushed the bootstrap_state_build_changes branch from b2385bc to 720c445 Compare November 26, 2024 09:44
@piyujai piyujai force-pushed the bootstrap_state_build_changes branch from 720c445 to e9b1d5a Compare November 26, 2024 09:44
@piyujai piyujai marked this pull request as ready for review November 26, 2024 09:45
@piyujai piyujai force-pushed the bootstrap_state_build_changes branch from f9b9cc8 to 1d17ad8 Compare November 28, 2024 09:01
@piyujai piyujai changed the title [WIP] Bootstrap FC optimization: Interfaces for state build and state transition flows Bootstrap FC optimization: Interfaces for state build and state transition flows Nov 28, 2024
@@ -674,6 +674,13 @@ public class StoreConfig {
public final boolean storeBlockStaleBlobStoreToStart;
public final static String storeBlockStaleBlobStoreToStartName = "store.block.stale.blob.store.to.start";


@Config(STORE_ENABLE_FILE_COPY_FOR_BOOTSTRAP)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

use serverReplicationProtocolForHydration

@@ -41,7 +41,8 @@ class PartitionStateChangeListenerImpl implements PartitionStateChangeListener {

@Override
public void onPartitionBecomeBootstrapFromOffline(String partitionName) {

// StateBuilding at the end of FCM's Offline->Bootstrap transition
storageManagerListener.buildStateForFileCopy(partitionName);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

move to storeManager

@piyujai piyujai force-pushed the bootstrap_state_build_changes branch from 1d17ad8 to 80d1bce Compare November 28, 2024 10:38
@piyujai piyujai force-pushed the bootstrap_state_build_changes branch from 80d1bce to 1124d46 Compare November 28, 2024 11:08
@piyujai piyujai force-pushed the bootstrap_state_build_changes branch from a621b02 to 6e10bcf Compare November 28, 2024 14:16
@piyujai piyujai merged commit 944356e into bootstrap-optimisation-lld-flow Nov 29, 2024
aga9900 pushed a commit that referenced this pull request Dec 3, 2024
…ition flows (#2946)

* Changes for bootstrap improvement with statebuild

* Added initial changes for state build

* Changes for moving state build to FCM

* Changes for state build including FCM invocation

* reformatting changes

---------

Co-authored-by: Jai Balani <jbalani@jbalani-mn1.linkedin.biz>
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.

2 participants