Skip to content

feat(web-console): system info - suspension and configuration - #291

Merged
glasstiger merged 100 commits into
mainfrom
web-console/suspended-tables
Jul 16, 2024
Merged

feat(web-console): system info - suspension and configuration#291
glasstiger merged 100 commits into
mainfrom
web-console/suspended-tables

Conversation

@insmac

@insmac insmac commented May 15, 2024

Copy link
Copy Markdown
Contributor

This PR depends on questdb/questdb#4607 and https://github.com/questdb/questdb-enterprise/pull/439

WAL tables can be suspended for writing for multiple reasons. This PR adds the indication and restart function into the UI, as well as other things in the Tables UI widget.
In addition to showing the suspension details, the popover contains Restart transaction action which could either be performed from the first applicable txn, or a specified number (optional)

Side changes:

  • Add filtering via keyword input - search in both table and column names, highlight the found portion of the text.
  • Simplify the Table components, remove regacy rxjs methods, use the reducer hook to handle view state
  • Store information_schema.columns() result in Redux, since it's shared by both Tables UI and SQL Editor, adjust the Editor's completion provider code to use redux selector.

Tables - changes to the header action bar

Screenshot 2024-06-14 at 10 30 32
  • A few people have reported not being able to find "create table" icon easily, therefore a "plus" one has been added in the top right.
  • Table schema is now refreshed automatically in almost all needed situations, including back to browser tab focus, so there is virtually no need to have the "refresh" action that prominent. There is a dropdown "action menu" added instead, which now houses both refresh and copy all schemas items.

Tables - list view with a suspended table

initial-view

Tables - details of the suspended table as a popover

error-expanded

Filter by keyword

filter

Test changes:

  • Added two CY commands for working with Web Console, getByDataHook() and interceptQuery(query, response), which are both self-explanatory.
  • Changed the Cypress config timeout so that spurious CI timeouts (which are not related to the code and never happen locally) don't pop up randomly, depending on the CI load.

@glasstiger

Copy link
Copy Markdown
Contributor

Testing WAL suspension:

  1. Check wal_tables() output, there should not be any suspended tables.
  2. Run alter table trades suspend wal with 'DISK FULL', 'test error', then check `wal_tables()' output.
  3. At this point trades table should be suspended and error tag and message should be populated as DISK FULL and test error.
    Suspension also should be indicated in the table view on the left side of the screen.
    When opening the suspension details panel there should be more details displayed, including a link to a page in the docs relevant for the issue.
    WAL apply can also be resumed by clicking on Resume WAL, or with the alter table trades resume wal SQL command.

Valid error tags are: "DISK FULL", "TOO MANY OPEN FILES", "OUT OF MMAP AREAS" and "OUT OF MEMORY"

@glasstiger

glasstiger commented Jul 11, 2024

Copy link
Copy Markdown
Contributor

Testing server configuration warnings:

  1. Run QuestDB on unsupported file system. Load the Web Console, it should display a warning saying something like: Unsupported file system [dir=/questdb/path/dbRoot, magic=0x6400A468]
  2. Set OS limit fs.file-max to anything below 65536. Load the Web Console, it should display a warning saying something like: fs.file-max limit is too low [current=1024, recommended=1048576]
  3. Set OS limit vm.max_map_count to anything below 65536. Load the Web Console, it should display a warning saying something like: vm.max_map_count limit is too low [current=2048, recommended=1048576]

Testing server configuration warnings with simulation:

  1. Add cairo.enable.warnings.simulation=true to your server config.
  2. When loading the Web Console there should not be any warnings.
  3. Run select simulate_warnings('UNSUPPORTED FILE SYSTEM', 'Unsupported file system [dir=/questdb/path/dbRoot, magic=0x6400A468]'). This should return with true. If not, warning simulation is not enabled, go back to step 1, and check if you added the config to server.conf.
  4. A warning should appear with the above message after reloading the console.
  5. Run select simulate_warnings('TOO MANY OPEN FILES', 'fs.file-max limit is too low [current=1024, recommended=1048576]'). This should also return with true.
  6. Reload the console again. Now you should see 2 warnings.
  7. Run select simulate_warnings('', ''). This should also return with true.
  8. Reload the console again. There should not be any warnings.

All warnings should include a link to a page in the docs relevant for the problem.

Valid warning tags are: "UNSUPPORTED FILE SYSTEM", "TOO MANY OPEN FILES" and "OUT OF MMAP AREAS"

@nwoolmer nwoolmer 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.

Looks good! I will follow up with some final UX testing once integrated. (subject to any further changes from feedback)

@nwoolmer nwoolmer 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.

Address feedback in Slack around tooltips for partition types.

@glasstiger
glasstiger merged commit 8568a0c into main Jul 16, 2024
@glasstiger
glasstiger deleted the web-console/suspended-tables branch July 16, 2024 12:58
Vaibhav91one pushed a commit to Vaibhav91one/ui that referenced this pull request Oct 28, 2025
…b#291)

* Fetch WAL Tables

* Filtering

* Suspended table indicator

* Pass WAL data to tables, show suspension

* TEMP: Use mocked query for `wal_tables()`

* Toggle suspended filter

* Suspended counter: adjust tooltip

* Filter column names, refactor `information_schema.columns()` into store

* Bring back `Add` feature

* Suspension details popover component

* Suspension popover: change types

* Suspension Popover: trigger UI

* Suspension popover: Add resume logic

* Add OS-specific error code mapping

* Refactor `<Schema>` to use state based views

* Suspension Popover: fix DOM structure

* Suspension Popover: updates, bring back mocks

* Add clear query icon

* Suspension Popover: add submit states

* Toolbar: dim filter icon slightly

* Add query highlighting

* Remove mocks

* Fix: loader state

* change `errorCode` to `errorMessage`

* Remove OS errorCodes utils

* Cypress: Add tests around Tables UI

* Add set of test scenarios for suspended tables

* Adjust the default timeout for CI purposes

* Add error tag support

* Refactor tests to use `SUSPEND WAL` instead of `wal_tables()` mocks

* Adjust schema header actions UI

* Hide suspended count with no suspended tables

* Remove `Add` action on row hover/click

* refactor `ErrorTag`, add new columns

* Add Warning UI

* Integrate the build SQL

* Add Partition type

* Add `Run` shortcut

* fix failing cypress test

* update questdb submodule

* Revert "Integrate the build SQL"

This reverts commit 0bb2959.

* Revert "Add Warning UI"

This reverts commit 58ea5e0.

* Revert "refactor `ErrorTag`, add new columns"

This reverts commit 46e1f56

* remove unnecessary import

* Restart transaction -> Resume WAL

* fixing merge

* Fix issue with appending queries

* simplify import

* simplify import

* Abtract out `Resume WAL` test

* renaming error tags

* Update suspension indications, remove table details

* New table icons

* Table icon tooltip

* Table row cleanup

* Create `SuspensionDialog` instead of popover

* Refactor `SuspensionDialog` UI

* `SuspensionDialog` styling updates

* Update error messages, cleanup popover

* Update tests

* Add server message text

* Change modal behaviour post restart

* update OSS project

* Add Warning logic mock

* Make error tags generic

* Integrate warnings with the API

* Add warning test sheet

* Update hooks for `schema.spec.js`

* questdb submodule update

* questdb submodule update

* enable warnings simulation in cypress questdb instance

* enable warnings simulation in cypress questdb instance

* experiment

* fix warning related test failure

* Refactor warning tests from mock to SQL commands

* Adjust the Tables UI styling

* Restyle table icons

* questdb submodule update

* questdb submodule update

* questdb submodule update

* Fix table UI on small pane width

* questdb submodule update

* update oss check script

* Add table icon tooltips

* Adjust tooltip

* tiny code cleanup

---------

Co-authored-by: glasstiger <94906625+glasstiger@users.noreply.github.com>
Co-authored-by: glasstiger <imre@questdb.io>
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.

3 participants