File tree 2 files changed +27
-2
lines changed
mongodb_consistent_backup/Backup/Mongodump
2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 1
- 1.4.7
1
+ 1.4.8
Original file line number Diff line number Diff line change @@ -131,6 +131,13 @@ def run(self):
131
131
secondary = self .replsets [shard ].find_secondary ()
132
132
mongo_uri = secondary ['uri' ]
133
133
self .states [shard ] = OplogState (self .manager , mongo_uri )
134
+
135
+ # Check if mongo_uri passes the check_or_cfg function
136
+ oplog = self .oplog_enabled
137
+ if self .check_or_cfg (mongo_uri .str ()):
138
+ oplog = False
139
+ logging .info ("No Oplog for %s as it belongs to objectrocket.com" % (mongo_uri .str ()))
140
+
134
141
thread = MongodumpThread (
135
142
self .states [shard ],
136
143
mongo_uri ,
@@ -140,7 +147,7 @@ def run(self):
140
147
self .version ,
141
148
self .threads (),
142
149
self .do_gzip (),
143
- self . oplog_enabled
150
+ oplog
144
151
)
145
152
self .dump_threads .append (thread )
146
153
except Exception , e :
@@ -179,3 +186,21 @@ def close(self):
179
186
pass
180
187
logging .info ("Stopped all mongodump threads" )
181
188
self .stopped = True
189
+
190
+ def check_or_cfg (self , uri ):
191
+ """
192
+ Checks whether the given URI contains the domain 'objectrocket.com'
193
+ and the substring 'cfg' within the domain.
194
+
195
+ Args:
196
+ uri (str): The URI to be checked, typically in the form of 'rs/domain.com'.
197
+
198
+ Returns:
199
+ bool:
200
+ - True if the URI contains the domain 'objectrocket.com' and 'cfg' in the domain part.
201
+ - False otherwise
202
+ """
203
+ rs , domain = uri .split ("/" , 1 )
204
+ if "objectrocket.com" in domain and "cfg" in domain :
205
+ return True
206
+ return False
You can’t perform that action at this time.
0 commit comments