Skip to content

Integrate lsm#2104

Draft
kderme wants to merge 27 commits intomasterfrom
kderme/integrate-node-10.7-lsm
Draft

Integrate lsm#2104
kderme wants to merge 27 commits intomasterfrom
kderme/integrate-node-10.7-lsm

Conversation

@kderme
Copy link
Copy Markdown
Contributor

@kderme kderme commented Apr 22, 2026

follow up to #2080

kderme and others added 27 commits April 2, 2026 01:49
And deprecated RewardAccount,StakeCredential
Fixes #2083

The `queryMinRefId` query uses
```sql
SELECT id FROM <table> WHERE <field> >= $1 ORDER BY id ASC LIMIT 1.
```

The planner sometimes picks a bad plan:

```sql
Index Scan using tx_pkey on tx
  Filter: (block_id >= $1)
```

the filter is not Index Cond, so this ends up in a sequential scan.
The index refers to the primary key and is only used for sorting.

Instead we use a simpler query without ORDER BY:

SELECT id FROM <table> WHERE <field> >= $1 LIMIT 10000
This forces the planner to use the field's index.
The results are fetched and the minimum is found in Haskell.
Near the tip this returns only a handful of rows.

If there are more than 10000 matching rows (large rollback),
we fall back to the original ORDER BY id ASC LIMIT 1 query.
This fixes the following static build errors resulting from updating
nixpkgs:

    (.text.use_builtin_flow+0x10): undefined reference to `pg_fe_cleanup_oauth_flow'
    collect2: error: ld returned 1 exit status

This works by removing curl support for postgresql and enabling static libraries
for liburing and snappy
This fixes builds for the dependencies haskell-language-server and
proto-lens.

proto-lens fails with:

    Error: [Cabal-6661]
    filepath wildcard 'proto-lens-imports/google/protobuf/descriptor.proto'
    refers to the directory 'proto-lens-imports/google/protobuf', which does not exist or is not a directory.
    filepath wildcard 'proto-lens-imports/google/protobuf/descriptor.proto'
    does not match any files.

However, SRP is currently required because the released version does not
support ghc-9.12.

The previous haskell-language-server did not support ghc-9.12, so we are
upgrading it to the latest version
The blockio package defaults to io_uring which requires liburing.
The devx CI environment does not provide liburing, so we use the
serialblockio flag instead.

TODO: revert when CI provides liburing or switch to io_uring for
better LSM I/O performance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants