Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: curio: fix incorrect null check for varchar column #11881

Merged
merged 2 commits into from
Apr 16, 2024

Conversation

LexLuthr
Copy link
Contributor

@LexLuthr LexLuthr commented Apr 15, 2024

Related Issues

Proposed Changes

null check against a varchar column can result in false negatives.

yugabyte=# SELECT * FROM curio.storage_path WHERE available >= 118279372 and NOW()-(50000000000 * INTERVAL '1 second') < last_heartbeat and heartbeat_err is null and ((true and can_seal = TRUE) or (false and can_store = TRUE)) order by (available::numeric * weight) desc;
 storage_id | urls | weight | max_storage | can_seal | can_store | groups | allow_to | allow_types | deny_types | capacity | available | fs_available | reserved | used | last_heartbeat | heartbeat_err | allow_miners | deny_miners 
------------+------+--------+-------------+----------+-----------+--------+----------+-------------+------------+----------+-----------+--------------+----------+------+----------------+---------------+--------------+-------------
(0 rows)

yugabyte=# SELECT * FROM curio.storage_path;
              storage_id              |             urls              | weight | max_storage | can_seal | can_store | groups | allow_to | allow_types | deny_types |   capacity   |  available   | fs_available | reserved | used |       last_heartbeat       | heartbeat_err | allow_miners | deny_miners 
--------------------------------------+-------------------------------+--------+-------------+----------+-----------+--------+----------+-------------+------------+--------------+--------------+--------------+----------+------+----------------------------+---------------+--------------+-------------
 01756dc0-3889-42a8-9b27-c831e9f413f7 | http://127.0.0.1:12300/remote |     10 |           0 | t        | t         |        |          |             |            | 994662584320 | 449571401728 | 449571401728 |        0 |    0 | 2024-04-16 00:17:30.920622 |               |              | 
(1 row)

yugabyte=# SELECT * FROM curio.storage_path WHERE available >= 118279372 and NOW()-(50000000000 * INTERVAL '1 second') < last_heartbeat and heartbeat_err = '' and ((true and can_seal = TRUE) or (false and can_store = TRUE)) order by (available::numeric * weight) desc;
              storage_id              |             urls              | weight | max_storage | can_seal | can_store | groups | allow_to | allow_types | deny_types |   capacity   |  available   | fs_available | reserved | used |       last_heartbeat       | heartbeat_err | allow_miners | deny_miners 
--------------------------------------+-------------------------------+--------+-------------+----------+-----------+--------+----------+-------------+------------+--------------+--------------+--------------+----------+------+----------------------------+---------------+--------------+-------------
 01756dc0-3889-42a8-9b27-c831e9f413f7 | http://127.0.0.1:12300/remote |     10 |           0 | t        | t         |        |          |             |            | 994662584320 | 449591689216 | 449591689216 |        0 |    0 | 2024-04-16 00:20:30.984384 |               |              | 
(1 row)

Additional Info

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section.
  • New features have usage guidelines and / or documentation updates in
  • Tests exist for new functionality or change in behavior
  • CI is green

@snadrus snadrus merged commit 3ebb92a into master Apr 16, 2024
186 checks passed
@snadrus snadrus deleted the fix/curio-storage branch April 16, 2024 00:27
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