Skip to content

[authority] Optimise storage of shared-objects locks - #978

Merged
asonnino merged 17 commits into
MystenLabs:mainfrom
asonnino:shared-objects-locks
Mar 21, 2022
Merged

asonnino merged 17 commits into
MystenLabs:mainfrom
asonnino:shared-objects-locks

Conversation

@asonnino

Copy link
Copy Markdown
Contributor

Fix #975

@asonnino asonnino added the Type: Enhancement New feature or request label Mar 21, 2022
@asonnino asonnino added this to the Post-GDC milestone Mar 21, 2022
@asonnino asonnino self-assigned this Mar 21, 2022
@asonnino
asonnino requested a review from gdanezis March 21, 2022 14:49

@huitseeker huitseeker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praying you manage to merge

@asonnino
asonnino merged commit ed436b9 into MystenLabs:main Mar 21, 2022
@asonnino
asonnino deleted the shared-objects-locks branch March 21, 2022 18:55
mwtian pushed a commit to mwtian/sui that referenced this pull request Sep 29, 2022
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.64 to 1.0.65.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](dtolnay/anyhow@1.0.64...1.0.65)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
nickvikeras added a commit that referenced this pull request Oct 19, 2026
…P/2 client connections (#28359)

## Description

kv-rpc cancels Bigtable range scans as soon as a page is full. It can't
know how many rows it needs until the merge-join has run, so nearly
every List request ends in cancelled streams
([details](hyperium/h2#983 (comment))).

h2 0.4.19 clients answer every frame that arrives late for a stream they
reset and have since forgotten with another `RST_STREAM`, and count each
one toward a per-connection limit (1024) that never goes down. At the
limit the client closes the connection with `GOAWAY(ENHANCE_YOUR_CALM,
"too_many_internal_resets")`, and every other read in flight on it
fails. On testnet this caused nearly all of kv-rpc's remaining server
errors after the List-scan refactor from #28308; hyperium/h2#856 is the
same report from uv.

hyperium/h2#983 makes clients discard HEADERS and DATA on those streams,
as RFC 9113 §5.1 requires ("minimally process and then discard") and as
the Go, nghttp2 and Chromium clients do. Flow control and HPACK state
stay in sync, servers are unchanged, and every other reset still counts
toward the limit. This pins h2 to that PR's commit (`44260b15`): h2
`master` (0.4.20 plus #977 and #978) with the fix on top. The commit is
fetched from branch `ignore-late-frames-983` of a fork,
`nickvikeras/h2`, so builds keep working if the PR branch is
force-pushed during review. Remove the pin once an h2 release includes
it.

The pin changes h2 for every HTTP/2 client and server in the workspace,
not only kv-rpc's Bigtable client. 0.4.20 also brings server-side
changes, such as refused streams counting toward the reset limit and
stricter `:status` and GOAWAY checks.

## Test plan

Deployed on 1.82 (`nickv/kv-rpc-h2-983-1.82`, `f9cbebd35f`) to kv-rpc
testnet and mainnet on 2026-10-18, and compared three ~23-hour windows:
before the List-scan refactor from #28308 was deployed (2026-10-16),
with the refactor only (the day before the pin), and with the refactor
and the pin. The pinned build also picked up #28348 from the 1.82 branch
(`sui-rpc-api` rendering, subscriptions, and `OUT_OF_RANGE` for pruned
transaction boundaries); nothing else differs from the refactor-only
build.

**Testnet**

| | Before refactor | Refactor only | Refactor + pin |
|---|---|---|---|
| Requests | 20.2M | 20.1M | 18.4M |
| Server errors | 3,452 | 372 | 4 |
| Availability | 99.98289% | 99.99815% | 99.99997% |
| 5-minute windows with a method below 99.9% | 41 of 276 | 2 of 278 | 0
of 278 |
| h2 `locally-reset streams reached limit` warnings | 1,465 | 459 | 0 |

**Mainnet**

| | Before refactor | Refactor only | Refactor + pin |
|---|---|---|---|
| Requests | 105.9M | 109.8M | 103.6M |
| Server errors | 23,203 | 1,035 | 381 |
| Availability | 99.97808% | 99.99905% | 99.99963% |
| 5-minute windows with a method below 99.9% | 110 of 276 | 2 of 276 | 0
of 276 |
| h2 `locally-reset streams reached limit` warnings | 1,285 | 7 | 0 |

- Server errors are `rpc_requests` with status `internal`, `unknown`,
`unavailable`, `resource-exhausted`, `deadline-exceeded` or `data-loss`,
excluding health checks. A breach is a method whose availability falls
below 99.9% in a non-overlapping 5-minute window.
- Both refactor-only breaches on testnet were h2 resets (88 and 11
`too_many_internal_resets` errors in those windows). The two on mainnet
were Bigtable closing connections (`connection closed`, `load_shed`),
which this pin doesn't address, and most of mainnet's remaining errors
are of that kind.
- Since the deploy, neither network has logged
`too_many_internal_resets`, the reset-limit warning, or
`too_many_data_frames` (0.4.20's new DATA frame limit), and no pod has
restarted.
- Locally, the Bigtable regression test from #28352
(`cancelled_read_bursts_do_not_fail_concurrent_reads`) fails on h2
0.4.19 with 445 failed reads and passes 3 of 3 runs on the pin. h2's own
test suite gives the same results on the pin as on h2 `master`.

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol:
- [ ] Nodes (Validators and Full nodes):
- [ ] gRPC:
- [ ] JSON-RPC:
- [ ] GraphQL:
- [ ] CLI:
- [ ] Rust SDK:
- [ ] Indexing Framework:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[authority] Optimise storage of shared-objects locks

2 participants