Skip to content

Commit 5ee3601

Browse files
committed
fix: avoid global writes for self managed sharding COMPASS_8579
1 parent e7ebaf1 commit 5ee3601

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

packages/compass-connections/src/utils/connection-supports.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ function supportsGlobalWrites(connectionInfo: ConnectionInfo) {
3030
return false;
3131
}
3232

33-
return atlasMetadata.clusterType === 'GEOSHARDED';
33+
return (
34+
atlasMetadata.clusterType === 'GEOSHARDED' &&
35+
!atlasMetadata.geoSharding?.selfManagedSharding
36+
);
3437
}
3538

3639
export function connectionSupports(

packages/compass-web/src/connection-storage.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ type ClusterDescription = {
3838
deploymentItemName: string;
3939
replicationSpecList?: ReplicationSpec[];
4040
isPaused?: boolean;
41+
geoSharding?: {
42+
selfManagedSharding?: boolean;
43+
};
4144
};
4245

4346
export type ClusterDescriptionWithDataProcessingRegion = ClusterDescription & {
@@ -205,6 +208,9 @@ export function buildConnectionInfoFromClusterDescription(
205208
...getMetricsIdAndType(description, deploymentItem),
206209
instanceSize: getInstanceSize(description),
207210
clusterType: description.clusterType,
211+
geoSharding: {
212+
selfManagedSharding: description.geoSharding?.selfManagedSharding,
213+
},
208214
},
209215
};
210216
}

packages/connection-info/src/connection-info.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ export interface AtlasClusterMetadata {
5656
* https://github.com/10gen/mms/blob/9e6bf2d81d4d85b5ac68a15bf471dcddc5922323/client/packages/types/nds/clusterDescription.ts#L12-L16
5757
*/
5858
clusterType: 'REPLICASET' | 'SHARDED' | 'GEOSHARDED';
59+
60+
geoSharding?: {
61+
selfManagedSharding?: boolean;
62+
};
5963
}
6064

6165
export interface ConnectionInfo {

0 commit comments

Comments
 (0)