[SERVER-23243] Extract time-keeping from Listener Created: 19/Mar/16  Updated: 05/Jul/16  Resolved: 14/Jun/16

Status: Closed
Project: Core Server
Component/s: Networking
Affects Version/s: None
Fix Version/s: 3.3.9

Type: Task Priority: Major - P3
Reporter: Samantha Ritter (Inactive) Assignee: Waley Chen
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-2114 Don't use select timeouts for fast co... Closed
Backwards Compatibility: Fully Compatible
Sprint: Platforms 12 (04/01/16), Platforms 13 (04/22/16), Platforms 14 (05/13/16), Platforms 15 (06/03/16), Platforms 16 (06/24/16)
Participants:
Linked BF Score: 0

 Description   

Research and answer the following questions:

  • Who uses the listener's time-keeping functionality?
  • Do we need to preserve this functionality in 3.4?
  • If so, must the time-keeping logic be in the Listener, or can it go elsewhere?
  • How could we implement time-keeping in an async ASIO Listener?
  • How could we implement time-keeping in a synchronous ASIO Listener?


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

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-23243 Remove time-keeping from listener
Branch: master
https://github.com/mongodb/mongo/commit/710159c9602a6738e6455cfb26bc2d70a0454ae2

Comment by Githook User [ 25/May/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-23243 Replace Listener::getElapsedTimeMillis() in scoped_timer.cpp
Branch: master
https://github.com/mongodb/mongo/commit/6f72d36c1c8fc757962150713756ed2a553d817c

Comment by Githook User [ 18/May/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: Revert "SERVER-23243 Replace Listener::getElapsedTimeMillis() in scoped_timer.cpp"

This reverts commit 51ee6f1952addc650b1c719cce51fcf460e6e9e8.
Branch: master
https://github.com/mongodb/mongo/commit/7480e5ed2e83b50da03a8e1f1ca1840e280644ef

Comment by Githook User [ 17/May/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-23243 Replace Listener::getElapsedTimeMillis() in scoped_timer.cpp
Branch: master
https://github.com/mongodb/mongo/commit/51ee6f1952addc650b1c719cce51fcf460e6e9e8

Comment by Githook User [ 10/May/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-23243 Replace Listener::getElapsedTimeMillis() in dur_journal.cpp
Branch: master
https://github.com/mongodb/mongo/commit/e381d56bfe3a805e44678566437ef4a732d3fa1a

Comment by Githook User [ 05/May/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-23243 Refactor KVHarnessHelper::create
Branch: master
https://github.com/mongodb/mongo/commit/1efbd7699da0536cec34a4392afd88f31b3832e3

Comment by Githook User [ 03/May/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-23243 Replace Listener::getElapsedTimeMillis() in elapsed_tracker.cpp
Branch: master
https://github.com/mongodb/mongo/commit/8abd5682f551ad79dec3557f721eebd45b21be0f

Comment by Githook User [ 03/May/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley', u'email': u'waleycz@gmail.com'}

Message: SERVER-23243 update WiredTigerKVEngine call
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/448289675af390cfff5c5b985bae99966ca686fc

Comment by Githook User [ 02/May/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: Revert "SERVER-23243 Replace Listener::getElapsedTimeMillis() in elapsed_tracker.cpp"

This reverts commit da38826985001daff55c7e2f723f73f5263e2dbf.
Branch: master
https://github.com/mongodb/mongo/commit/7f8861fbb04b9188e793f762fe2cfc01266fcf30

Comment by Githook User [ 02/May/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-23243 Replace Listener::getElapsedTimeMillis() in elapsed_tracker.cpp
Branch: master
https://github.com/mongodb/mongo/commit/da38826985001daff55c7e2f723f73f5263e2dbf

Comment by Githook User [ 28/Apr/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-23243 Replace Listener::getElapsedTimeMillis() in record_access_tracker.cpp
Branch: master
https://github.com/mongodb/mongo/commit/dd3f158aef4bd82f43fe4de8a46fb76f28ddeef7

Comment by Githook User [ 25/Apr/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-23243 Replace the easy-to-remove usages of Listener::getElapsedTimeMillis()
Branch: master
https://github.com/mongodb/mongo/commit/046441de98dd72689397a4a06f8a68ef58a4c226

Comment by Githook User [ 15/Apr/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-23243 Add getPrecision to ClockSource
Branch: master
https://github.com/mongodb/mongo/commit/de534119c84dfd07ecf9401de94d3524268ec6fa

Comment by Githook User [ 15/Apr/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-23243 Extract time-keeping from Listener

BackgroundThreadClockSource & FastClockSourceFactory
Branch: master
https://github.com/mongodb/mongo/commit/c2041cd99ea8ff1aa8bfba2d4bcb3bbd2ea7932c

Comment by Githook User [ 07/Apr/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-23243 Extract time-keeping from Listener
fix compile error from previous commit
Branch: master
https://github.com/mongodb/mongo/commit/af5080d9478a9340ec4f54ae7f9e8e881cbc275e

Comment by Githook User [ 07/Apr/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-23243 Extract time-keeping from Listener

Renaming so we can differentiate between the two types of clocks (fast and precise):
1. setClockSource() -> setPreciseClockSource()
2. _clockSource -> _preciseClockSource
Branch: master
https://github.com/mongodb/mongo/commit/97d7ef4a5120cf7e7d6d912c0f0381663d9d0c3e

Comment by Githook User [ 30/Mar/16 ]

Author:

{u'username': u'WaleyChen', u'name': u'Waley Chen', u'email': u'waleycz@gmail.com'}

Message: SERVER-23243 Extract time-keeping from Listener

Step 1: getClockSource() -> getPreciseClockSource()
Branch: master
https://github.com/mongodb/mongo/commit/58a490d466b31f70384b7173aa50fb32ac487563

Comment by Andy Schwerin [ 21/Mar/16 ]

The cheap version of my solution is to leave out the part where you detect at startup if the wallclock is fast enough to use for the "fast clock source" and assume it is not. You can then add that later, as a power and clock precision optimization.

Comment by Andrew Morrow (Inactive) [ 21/Mar/16 ]

I like schwerin's suggestion. The listener has never been the right place for this, so I support moving it elsewhere. It would also greatly reduce the power consumption of an idle mongod since it would not wake up all the time if it had a good clock source (see SERVER-2114).

Comment by Andy Schwerin [ 21/Mar/16 ]

I'm pretty sure that we should get the Listener out of the timekeeping business. Instead, we should add a new ClockSource to ServiceContext called "fast clock" or something, and that ClockSource should read the fastest wall clock available on the system. On systems with no built-in fast wall clock, we should use a periodic timer to build a low-resolution, fast-to-read clock for uses that do not require high resolution. The existing "getClockSource" on ServiceContext should be called getPreciseClockSource, and Date_t::now() and other clock-reading functions should be deprecated. If we do these things, we can get rid of Listener's time-keeping functionality and replace it with a sensible system.

The hardest part of this plan would be testing at startup to determine which implementations of ClockSource to use for the precise and fast clocks.

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