Skip to content

Commit c8f8881

Browse files
committed
Check for wired tiger storage engine
1 parent 6de8a92 commit c8f8881

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

django_mongodb_backend/features.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,17 @@ def supports_transactions(self):
103103
with self.connection.cursor():
104104
client = self.connection.connection
105105
hello_response = client.admin.command("hello")
106+
server_status = client.admin.command("serverStatus")
106107
if "setName" in hello_response:
107108
is_replica_set = True
108-
if "msg" in client.admin.command("hello") and hello_response["msg"] == "isdbgrid":
109+
if "msg" in hello_response and hello_response["msg"] == "isdbgrid":
109110
is_sharded_cluster = True
110-
if is_replica_set or is_sharded_cluster:
111+
if (
112+
"storageEngine" in server_status
113+
and server_status["storageEngine"].get("name") == "wiredTiger"
114+
):
115+
is_wired_tiger = True
116+
if (is_replica_set or is_sharded_cluster) and is_wired_tiger:
111117
return True
112118
return False
113119

0 commit comments

Comments
 (0)