[SERVER-29508] Add backoff to key collection manager refresh scheduling Created: 07/Jun/17  Updated: 30/Oct/23  Resolved: 13/Jun/17

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

Type: Bug Priority: Major - P3
Reporter: Misha Tyulenev Assignee: Misha Tyulenev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2017-06-19
Participants:

 Description   

The following executor configuration

executor:
  config:
    shell_options:
      global_vars:
        TestData:
          auth: true
          authMechanism: SCRAM-SHA-1
          keyFile: *keyFile
          keyFileData: *keyFileData
      nodb: ''
      readMode: commands
  fixture:
    class: ShardedClusterFixture
    mongos_options:
      bind_ip_all: ''
      set_parameters:
        enableTestCommands: 1
        logComponentVerbosity:
          verbosity: 0
          command: 1
          network:
            verbosity: 1
            asio: 2
          tracking: 1 
 
    mongod_options:
      bind_ip_all: ''
      nopreallocj: ''
      enableMajorityReadConcern: ''
      set_parameters:
        enableTestCommands: 1
        logComponentVerbosity:
          verbosity: 0
          command: 1
          network:
            verbosity: 1
            asio: 2
          replication:
            heartbeats: 2
          tracking: 1 
        numInitialSyncAttempts: 1
    num_rs_nodes_per_shard: 2
    enable_sharding:
    - test

this executor when run in resmoke will show too frequent key refresh events in its log. Need to adjust the scheduling in the presence of failures.



 Comments   
Comment by Githook User [ 13/Jun/17 ]

Author:

{u'username': u'mikety', u'name': u'Misha Tyulenev', u'email': u'misha@mongodb.com'}

Message: SERVER-29508 Add backoff to key collection manager refresh scheduling
Branch: master
https://github.com/mongodb/mongo/commit/c7aa40633696a49fea2e75750b30a8339117d072

Comment by Randolph Tan [ 08/Jun/17 ]

I was not able to reproduce the "not stopping refresh on shutdown" but I was able to figure out why it was attempting to refresh so often. I found out that there are 2 contributing factors:

1. At the beginning, attempting to read the key will fail with "Read concern majority reads are currently not possible"
2. There is a bug in the howMuchSleepNeedFor function that made it return 200ms instead of the long interval.

We can potentially mitigate #1 by adding backoff and #2 can be fixed by changing this line to:

return Milliseconds(millisBeforeExpire);

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