Currently, the established pattern used throughout the server, for example in the ConfigurationManager, DataTransfer, CompressedDataManager, UncompressedDataManager, and DataOptimizer components, is that we clone local_data_folder and remote_data_folder and pass the cloned instances to the various components.
Instead DataFolder should own a single copy of its fields and then the entire DataFolder struct should be shared instead using an Arc. The result should be that there is a single local DataFolder instance and a single remote DataFolder instance. The same logic should be applied to handle the way we currently clone either the local or remote DataFolder for the query_data_folder, if possible.
Before this change is implemented, we should make sure that this does not cause any issues with either correctness or performance. The DataFolder fields are mostly static but the dynamic cache and dynamic session context could cause issues. We should also double check if this is an issue elsewhere in the server or in other crates.
Currently, the established pattern used throughout the server, for example in the
ConfigurationManager,DataTransfer,CompressedDataManager,UncompressedDataManager, andDataOptimizercomponents, is that we clonelocal_data_folderandremote_data_folderand pass the cloned instances to the various components.Instead
DataFoldershould own a single copy of its fields and then the entireDataFolderstruct should be shared instead using anArc. The result should be that there is a single localDataFolderinstance and a single remoteDataFolderinstance. The same logic should be applied to handle the way we currently clone either the local or remoteDataFolderfor thequery_data_folder, if possible.Before this change is implemented, we should make sure that this does not cause any issues with either correctness or performance. The
DataFolderfields are mostly static but the dynamic cache and dynamic session context could cause issues. We should also double check if this is an issue elsewhere in the server or in other crates.