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

Add filters to Running Compactions table in monitor #4986

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

DomGarguilo
Copy link
Member

@DomGarguilo DomGarguilo commented Oct 15, 2024

Fixes #4940
This PR adds regex filtering to the Running Compactions table on the External Compactions page in the monitor.

Features:

  • regex filtering for hostname, queue and table ID
  • warning to alert user that input is not a valid regex
  • collapsible filters section

This is marked as WIP because the ticket requested age filtering and that has yet to be added.

@DomGarguilo DomGarguilo self-assigned this Oct 15, 2024
@DomGarguilo
Copy link
Member Author

I added 9a218d6 to show how I was injecting the test data. If anyone wants to try these changes out you could use that commit in some form. Here is what the table looks like with some sample filters applied and one invalid filter:
Screenshot from 2024-10-15 16-09-37

@DomGarguilo DomGarguilo added this to the 4.0.0 milestone Oct 16, 2024
@DomGarguilo DomGarguilo changed the title WIP - Add filters to Running Compactions table in monitor Add filters to Running Compactions table in monitor Oct 17, 2024
@DomGarguilo
Copy link
Member Author

Marking as ready for review. The duration filter has been added and everything is working as intended as far as I can tell. If anyone wants to try out these changes, I would recommend checking out 4828fdb which was before the test data was removed.

@keith-turner
Copy link
Contributor

keith-turner commented Oct 18, 2024

I tried running continuous ingest to generate compactions. Was able to create lots of compactions that I could see in the shell using listcompactions, however I never saw any on this page. While running this test I ran into #4998, #4999,apache/accumulo-testing#285, and apache/accumulo-testing#284

Copy link
Member

@kevinrr888 kevinrr888 left a comment

Choose a reason for hiding this comment

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

These changes look really nice and work well. Styling is consistent with the rest of the Monitor pages. Filtering works well and as expected. I like the choice on having a "Toggle Filters" button. Left a few small code comments, and a few general comments below:

  • Duration filter shows "invalid duration format" after invalid entry is cleared and the box is empty. Would be nice if this message did not show in this case. This is not true for the other filters. Not sure how simply this can be done in current code, can ignore if changes are too large.
  • Noticed if filters are applied and then the "Toggle Filters" is turned back off, the filters are still applied to the table. It might be nicer if the filters are cleared on "Toggle Filters". This is just a style choice, so feel free to ignore if you prefer the current impl. Maybe if it is kept as it currently is "Toggle Filters" could be changed to "Show Filters".

Comment on lines 212 to 229
default:
return true;
}
});

// Helper function to convert duration strings to seconds
function convertToSeconds(value, unit) {
switch (unit.toLowerCase()) {
case 's':
return value;
case 'm':
return value * 60;
case 'h':
return value * 3600;
case 'd':
return value * 86400;
default:
return value;
Copy link
Member

Choose a reason for hiding this comment

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

212 and 228
Should these throw an error instead? We wouldn't expect the default to occur, correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in 263b617. I added console.error logs. I dont think we want things to break if the default case is reached but logging an error seems like a good idea to indicate something has gone wrong.

@DomGarguilo
Copy link
Member Author

  • Duration filter shows "invalid duration format" after invalid entry is cleared and the box is empty. Would be nice if this message did not show in this case. This is not true for the other filters. Not sure how simply this can be done in current code, can ignore if changes are too large.

Good catch, I did not notice that. I can fix that pretty easily I think.

  • Noticed if filters are applied and then the "Toggle Filters" is turned back off, the filters are still applied to the table. It might be nicer if the filters are cleared on "Toggle Filters". This is just a style choice, so feel free to ignore if you prefer the current impl. Maybe if it is kept as it currently is "Toggle Filters" could be changed to "Show Filters".

Yea the "Toggle Filters" button is a bit misleading. It just minimizes the input fields. The filters are still applied while its minimized. Maybe a different indicator other than "toggle" should be used. Also, adding a clear filters button sounds like a good idea.

* @param {number} durationStr duration in milliseconds
* @returns duration in seconds
*/
function parseDuration(durationStr) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I tried running this again and figured out why I was not seeing any data. I had some config in my browser that was sending /rest/ec/running request to /dev/null.

Once I fixed that I could see data and noticed compaction ages were in years. Looked into this and I think its a unit mismatch. RunningCompactionInfo.java has the following line

   duration = last.getCompactionAgeNanos();

This function is expecting millis and maybe its getting nanos.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea it looks like thats the case. I thought it was a bug with how I was creating the sample data. The bug might be present in 2.1 as well.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm. I didn't notice this. For me, the sample data seemed normal (nothing over a couple hrs)

Copy link
Member Author

Choose a reason for hiding this comment

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

Should be fixed via #5007. @keith-turner @kevinrr888

Copy link
Contributor

Choose a reason for hiding this comment

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

When experimenting with these changes I was using accumulo-testing cingest to generate compactions. I started 10 compactor processes locally and ran ingest for a bit. The compactions were normally really fast and would not show up reliably. After a bit of data had built up, I forced full table compactions to create longer running compactions that I could look at in the monitor.

@DomGarguilo
Copy link
Member Author

DomGarguilo commented Oct 22, 2024 via email

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.

Add ability to filter running compactions in the monitor
3 participants