[SERVER-85877] Use restartable sequences to implement a 64-bit counter Created: 29/Jan/24  Updated: 30/Jan/24

Status: Backlog
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Amirsaman Memaripour Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-85879 Add librseq as a new third party Backlog
Related
related to SERVER-85883 Allow extending arbitrary types with ... In Progress
Assigned Teams:
Service Arch
Participants:

 Description   

The counter (i.e. Counter) will point to a contiguous region of memory containing all of its partitions. It will use rseq to implement increment operations:

  • The start (restart) code will use the following to index the array of counters and compute the address for the partition that needs to be updated:
    • The identifier of the logical core running the update. This is used to index a lookup table that comes before the counter storage. The following figure is an illustration of the memory layout for an object with 7 counters (yellow boxes) running on a 4 core system.
    • The (zero-based) offset assigned to the counter.
  • The commit code will perform the requested update (increment or decrement) on the address computed in the previous stage.

It also provides a read API that returns the aggregate of all partitions for the counter. This will be the building block to implement CounterHolder.


Generated at Thu Feb 08 06:58:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.