[SERVER-26107] refreshMetadata should not be called when not sharded Created: 14/Sep/16  Updated: 19/Nov/16  Resolved: 20/Sep/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 3.3.14

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Kaloian Manassiev
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-26184 Seems like some sharding hooks are ru... Closed
is duplicated by SERVER-26172 Better logging in MetadataManager::re... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2016-09-19, Sharding 2016-10-10
Participants:

 Description   

Otherwise, you get this in your non-sharded log every time you step down:

[js_test:linearizable_read_concern] 2016-09-14T09:28:48.885-0400 d20013| 2016-09-14T09:28:48.884-0400 I SHARDING [conn2] Marking collection as not sharded.
[js_test:linearizable_read_concern] 2016-09-14T09:28:48.885-0400 d20013| 2016-09-14T09:28:48.884-0400 I -        [conn1] end connection 127.0.0.1:40044 (7 connections now open)
[js_test:linearizable_read_concern] 2016-09-14T09:28:48.886-0400 d20013| 2016-09-14T09:28:48.884-0400 I SHARDING [conn2] Marking collection as not sharded.
[js_test:linearizable_read_concern] 2016-09-14T09:28:48.886-0400 d20013| 2016-09-14T09:28:48.884-0400 I SHARDING [conn2] Marking collection as not sharded.
[js_test:linearizable_read_concern] 2016-09-14T09:28:48.886-0400 d20013| 2016-09-14T09:28:48.884-0400 I SHARDING [conn2] Marking collection as not sharded.
[js_test:linearizable_read_concern] 2016-09-14T09:28:48.886-0400 d20013| 2016-09-14T09:28:48.884-0400 I SHARDING [conn2] Marking collection as not sharded.
[js_test:linearizable_read_concern] 2016-09-14T09:28:48.886-0400 d20013| 2016-09-14T09:28:48.884-0400 I SHARDING [conn2] Marking collection as not sharded.
[js_test:linearizable_read_concern] 2016-09-14T09:28:48.886-0400 d20013| 2016-09-14T09:28:48.884-0400 I SHARDING [conn2] Marking collection as not sharded.
[js_test:linearizable_read_concern] 2016-09-14T09:28:48.886-0400 d20013| 2016-09-14T09:28:48.884-0400 I SHARDING [conn2] Marking collection as not sharded.
[js_test:linearizable_read_concern] 2016-09-14T09:28:48.886-0400 d20013| 2016-09-14T09:28:48.884-0400 I SHARDING [conn2] Marking collection as not sharded.

And every time you step up too!

[js_test:linearizable_read_concern] 2016-09-14T09:28:17.412-0400 d20013| 2016-09-14T09:28:17.411-0400 I SHARDING [rsSync] Marking collection as not sharded.
[js_test:linearizable_read_concern] 2016-09-14T09:28:17.412-0400 d20013| 2016-09-14T09:28:17.411-0400 I SHARDING [rsSync] Marking collection as not sharded.
[js_test:linearizable_read_concern] 2016-09-14T09:28:17.412-0400 d20013| 2016-09-14T09:28:17.411-0400 I SHARDING [rsSync] Marking collection as not sharded.
[js_test:linearizable_read_concern] 2016-09-14T09:28:17.412-0400 d20013| 2016-09-14T09:28:17.411-0400 I SHARDING [rsSync] Marking collection as not sharded.
[js_test:linearizable_read_concern] 2016-09-14T09:28:17.412-0400 d20013| 2016-09-14T09:28:17.411-0400 I SHARDING [rsSync] Marking collection as not sharded.
[js_test:linearizable_read_concern] 2016-09-14T09:28:17.412-0400 d20013| 2016-09-14T09:28:17.411-0400 I SHARDING [rsSync] Marking collection as not sharded.
[js_test:linearizable_read_concern] 2016-09-14T09:28:17.412-0400 d20013| 2016-09-14T09:28:17.411-0400 I SHARDING [rsSync] Marking collection as not sharded.
[js_test:linearizable_read_concern] 2016-09-14T09:28:17.412-0400 d20013| 2016-09-14T09:28:17.411-0400 I SHARDING [rsSync] Marking collection as not sharded.
[js_test:linearizable_read_concern] 2016-09-14T09:28:17.412-0400 d20013| 2016-09-14T09:28:17.411-0400 I REPL     [rsSync] transition to primary complete; database writes are now permitted

In addition, the utility of this log message is minimal, so it should not be getting logged at the default log level (0).



 Comments   
Comment by Githook User [ 20/Sep/16 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-26107 Improve logging around sharding metadata refresh in MetadataManager
Branch: master
https://github.com/mongodb/mongo/commit/acd6a7824dca76a94ee872d9e86df9487f406fd2

Comment by Kaloian Manassiev [ 19/Sep/16 ]

All code, which checks for sharding-related information goes through the CollectionShardingState interface, which does not differentiate between whether the server is running in shard mode or not. Because of this, we always instantiate a CollectionShardingState object for each collection, which in the unsharded state is just empty.

The fix would be to just reduce the extraneous logging when the collection sharding state has not changed, but refreshMetadata will always be called.

Generated at Thu Feb 08 04:11:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.