[DOCS-342] Background index behaviour on a secondary Created: 18/Jul/12  Updated: 30/Oct/23  Resolved: 24/Jul/12

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Task Priority: Major - P3
Reporter: Stennie Steneker (Inactive) Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-2771 Background index builds on replica se... Closed
Participants:
Days since reply: 11 years, 30 weeks, 1 day ago

 Description   

It looks like the information on building background indexes on a secondary may be based on an incorrect commit comment for SERVER-2771:
http://www.mongodb.org/display/DOCS/Building+indexes+with+replica+sets#Buildingindexeswithreplicasets-Version2.1.0andlater

The comment from Kristina says:

Index builds will now happen in the background on secondaries if they happen in the background on the primary. This means that reads can continue while the index builds. However, replication will block until the index build is complete.

.. but the preceding commit actually appears to change the background index on the primary to a foreground index with the log message:

info: indexing in foreground on this replica; was a background index build on the primary



 Comments   
Comment by Sam Kleinman (Inactive) [ 24/Jul/12 ]

new docs pushed, and this point is clarified.

Comment by Sam Kleinman (Inactive) [ 23/Jul/12 ]

The new docs have the new behavior, and will go out today. I've just edited the wiki pages to reflect this change.

I'm going to make a new docs ticket for can't kill foreground index operation.

Comment by Daniel Pasette (Inactive) [ 22/Jul/12 ]

On a related note, I think we should document SERVER-3067 (can't kill a foreground index operation) on the index page. This is super important since it takes a write lock and prevents reads and writes on that database durin the duration of the index build.

Comment by Daniel Pasette (Inactive) [ 22/Jul/12 ]

Sam, the wiki page is still incorrect as stephen pointed out. The fix to allow background:true to be propagated to secondaries did not make it 2.2.0

Can you fix that where it appears on either the wiki or the new docs?

Comment by Sam Kleinman (Inactive) [ 20/Jul/12 ]

Fixed in the commits that resolved DOCS-330

Comment by Sam Kleinman (Inactive) [ 18/Jul/12 ]

I've updated the wiki pages to reflect the facts:

  • If you specify background: true when creating the index on the primary, secondaries in 2.1 and 2.2 will build the index in the background. This allows secondary (i.e. slaveOk) reads to continue while building the index.
  • Replication will halt on a secondary while the index is built (in the background.)

I'm going to update the new docs (which are still in draft status) with this fact shortly, but I think it'd be ok to close this ticket if you're ok with that?

Comment by Stennie Steneker (Inactive) [ 18/Jul/12 ]

Also mentioned here: http://www.mongodb.org/display/DOCS/Indexing+as+a+Background+Operation

Generated at Thu Feb 08 07:38:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.