summaryrefslogtreecommitdiff
path: root/src/mongo/db/dbcommands_generic.cpp
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2012-08-08 11:32:39 -0400
committerEric Milkie <milkie@10gen.com>2012-08-08 11:39:46 -0400
commitc7d800c733ecbfdde9e2594c11d1b25cd1e7ceeb (patch)
tree7f9ec31024c797519269c45c584b7e69ef6c2671 /src/mongo/db/dbcommands_generic.cpp
parentc879a4c3a04cad2f13c1ced41ac648f93dbbb839 (diff)
downloadmongo-c7d800c733ecbfdde9e2594c11d1b25cd1e7ceeb.tar.gz
SERVER-6718 new parameter to control replication index prefetching behavior
New parameter replIndexPrefetch. Settable via the command line or use setParameter() command on a running server. Only valid on a server started with --replSet parameter. This allows a user to disable the prefetching of all index pages prior to the application of a replicated op on a secondary. For most use cases, prefetching all indexes for a given op will provide good performance. For use cases that do many in-place updates to documents in a collection with many indexes that are unaffected by such updates, using the '_id_only' setting may provide better performance than the 'all' setting. The '_id_only' setting only prefetches index pages for the _id index, which will always be used to find the document needed to be updated. The 'none' setting will be used for debugging only; there should be no production use cases for this setting. getParameter() supports getting the current value of this parameter.
Diffstat (limited to 'src/mongo/db/dbcommands_generic.cpp')
-rw-r--r--src/mongo/db/dbcommands_generic.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/db/dbcommands_generic.cpp b/src/mongo/db/dbcommands_generic.cpp
index 84d57b8769e..ff128dbd1ff 100644
--- a/src/mongo/db/dbcommands_generic.cpp
+++ b/src/mongo/db/dbcommands_generic.cpp
@@ -124,6 +124,8 @@ namespace mongo {
*/
unsigned replApplyBatchSize = 1;
+ const char* fetchReplIndexPrefetchParam();
+
class CmdGet : public Command {
public:
CmdGet() : Command( "getParameter" ) { }
@@ -160,7 +162,9 @@ namespace mongo {
if( all || cmdObj.hasElement("replApplyBatchSize") ) {
result.append("replApplyBatchSize", replApplyBatchSize);
}
-
+ if (all || cmdObj.hasElement("replIndexPrefetch")) {
+ result.append("replIndexPrefetch", fetchReplIndexPrefetchParam());
+ }
if ( before == result.len() ) {
errmsg = "no option found to get";
return false;