Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

implements cursor for gossip crds table queries (backport #16952) #17084

Merged
merged 1 commit into from
May 6, 2021

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented May 6, 2021

This is an automatic backport of pull request #16952 done by Mergify.


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.io/

VersionedCrdsValue.insert_timestamp is used for fetching crds values
inserted since last query:
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/cluster_info.rs#L1197-L1215
https://github.com/solana-labs/solana/blob/ec37a843a/core/src/cluster_info.rs#L1274-L1298

So it is crucial that insert_timestamp does not go backward in time when
new values are inserted into the table. However std::time::SystemTime is
not monotonic, or due to workload, lock contention, thread scheduling,
etc, ... new values may be inserted with a stalled timestamp way in the
past. Additionally, reading system time for the above purpose is
inefficient/unnecessary.

This commit adds an ordinal index to crds values indicating their insert
order. Additionally, it implements a new Cursor type for fetching values
inserted since last query.

(cherry picked from commit fa86a33)
@mergify mergify bot added the automerge Merge this Pull Request automatically once CI passes label May 6, 2021
@codecov
Copy link

codecov bot commented May 6, 2021

Codecov Report

Merging #17084 (78c597c) into v1.6 (5d088c7) will increase coverage by 0.0%.
The diff coverage is 96.0%.

@@           Coverage Diff           @@
##             v1.6   #17084   +/-   ##
=======================================
  Coverage    82.6%    82.6%           
=======================================
  Files         418      418           
  Lines      115666   115685   +19     
=======================================
+ Hits        95634    95670   +36     
+ Misses      20032    20015   -17     

@mergify mergify bot merged commit 330f42c into v1.6 May 6, 2021
@mergify mergify bot deleted the mergify/bp/v1.6/pr-16952 branch May 6, 2021 15:23
@brooksprumo brooksprumo mentioned this pull request Aug 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant