MongoDB Questions and Answers – Replica Set High Availability

«
»

This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Replica Set High Availability”.

1. Replica sets provide high availability using automatic ________
a) failover
b) replication
c) failure
d) all of the mentioned
View Answer

Answer: a
Explanation: Failover, in most situations does not require manual intervention.

2. Point out the wrong statement.
a) When the primary rejoins the set as a secondary, it reverts, or “rolls back,” its write operations to maintain database consistency with the other members
b) A rollback is necessary only if the primary had accepted write operations that the secondaries had not successfully replicated before the primary stepped down
c) MongoDB attempts for rollbacks, which should be rare
d) None of the mentioned
View Answer

Answer: c
Explanation: When a rollback does occur, it is often the result of a network partition.

advertisement

3. Failover allows a ________ member to become primary if primary is unavailable.
a) Hidden
b) Primary
c) ViewState
d) Secondary
View Answer

Answer: d
Explanation: Replica set members keep the same data set but are otherwise independent.

4. Sometimes the failover process may require a ____________ during operation.
a) savepoint
b) rollback
c) commit
d) none of the mentioned
View Answer

Answer: b
Explanation: A rollback reverts write operations on a former primary when the member rejoins its replica set after a failover.

Note: Join free Sanfoundry classes at Telegram or Youtube
advertisement
advertisement

5. Point out the correct statement.
a) A rollback does not occur if the write operations replicate to another member of the replica set before the primary steps down
b) Secondaries that can not keep up with the throughput of operations on the former primary, decrease the size and impact of the rollback
c) Fault tolerance is an effect of replica set size, but the relationship is not direct
d) None of the mentioned
View Answer

Answer: a
Explanation: When a rollback does occur, administrators must decide whether to apply or ignore the rollback data.

6. MongoDB writes the rollback data to BSON files in the rollback/ folder under the database’s ________ directory.
a) dbPath
b) logPath
c) dataPath
d) all of the mentioned
View Answer

Answer: a
Explanation: The storage.dbPath setting is available only for mongod.

Take MongoDB Practice Tests - Chapterwise!
Start the Test Now: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
advertisement

7. The names of rollback files have the following form.
a) <database>.<collection>.<timestamp>.bson.
b) <database>.<collection>.<tp>.bson.
c) <database>.<collection>.<timestamp>.json.
d) None of the mentioned
View Answer

Answer: a
Explanation: Administrators must apply rollback data manually after the member completes the rollback and returns to secondary status.

8. _________ is used to read the contents of the rollback files.
a) bsondumpdata
b) bsondp
c) bsondump
d) none of the mentioned
View Answer

Answer: c
Explanation: The bsondump converts BSON files into human-readable formats, including JSON.

advertisement

9. Use ______ to apply the changes to the new primary after rollback.
a) mongostore
b) mongorestore
c) restore
d) none of the mentioned
View Answer

Answer: b
Explanation: The mongorestore program writes data from a binary database dump created by mongodump to a MongoDB instance.

10. mongorestore recreates indexes recorded by _____________
a) bsondump
b) mongodump
c) mongostore
d) all of the mentioned
View Answer

Answer: b
Explanation: The data format used by mongodump from version 2.2 or later is incompatible with earlier versions of mongod.

advertisement

Sanfoundry Global Education & Learning Series – MongoDB.

Here’s the list of Best Books in MongoDB.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & technical discussions at Telegram SanfoundryClasses.