Bug #21204
closed
logging panel needs to use a stable sort
Added by Peter Amstutz about 1 year ago.
Updated about 1 year ago.
Release relationship:
Auto
Description
The logging panel sorts by timestamp, but this has the effect that lines with the same timestamp get sorted together in a way that messes up the original order.
This needs to
a) only sort by timestamp and not the rest of the line
b) use a stable sort (i.e. one that doesn't modify the original ordering for equivalent lines)
Because we're merging logs that are already in order, we don't need to sort at all, we just need to perform a merge that takes the next earliest line from each source.
- Description updated (diff)
- Assigned To set to Stephen Smith
- Target version changed from Development 2023-11-29 sprint to Development 2024-01-03 sprint
Changes at arvados|dea8c169f9d38e5a7c518514450c0955648d58bd branch 21204-stable-log-sort
Tests developer-run-tests-services-workbench2: #81
- All agreed upon points are implemented / addressed.
- Changed sorting to preserve original ordering of lines of the same type
- Lines with different types but matching timestamps are sorted by type, the result is that lines of matching timestamp will be grouped by type one after another, with lines within a type preserving original order
- Added more tests for preserving original ordering of sorted lines within a single type while correctly ordering/grouping matching timestamp lines of differing types
- Anything not implemented (discovered or discussed during work) has a follow-up story.
- Code is tested and passing, both automated and manual, what manual testing was done is described
- done, added test cases to ensure correct sorting brhavior
- Documentation has been updated.
- Behaves appropriately at the intended scale (describe intended scale).
- Minimal performance impact expected, since only the sort comparator function was tweaked and a reduce/concat replaced with a map/reduce to provide the necessary information for the sort comparator
- Considered backwards and forwards compatibility issues between client and server.
- Follows our coding standards and GUI style guidelines.
- Status changed from New to In Progress
- Release changed from 69 to 67
Stephen Smith wrote in #note-4:
Changes at arvados|dea8c169f9d38e5a7c518514450c0955648d58bd branch 21204-stable-log-sort
Tests developer-run-tests-services-workbench2: #81
- All agreed upon points are implemented / addressed.
- Changed sorting to preserve original ordering of lines of the same type
- Lines with different types but matching timestamps are sorted by type, the result is that lines of matching timestamp will be grouped by type one after another, with lines within a type preserving original order
- Added more tests for preserving original ordering of sorted lines within a single type while correctly ordering/grouping matching timestamp lines of differing types
- Anything not implemented (discovered or discussed during work) has a follow-up story.
- Code is tested and passing, both automated and manual, what manual testing was done is described
- done, added test cases to ensure correct sorting brhavior
- Documentation has been updated.
- Behaves appropriately at the intended scale (describe intended scale).
- Minimal performance impact expected, since only the sort comparator function was tweaked and a reduce/concat replaced with a map/reduce to provide the necessary information for the sort comparator
- Considered backwards and forwards compatibility issues between client and server.
- Follows our coding standards and GUI style guidelines.
So, this works and I'm fine with it, LGTM.
But I suspect if you moved timestampMatch
into sortableLineSortFunc
you could eliminate the map/reduce step and also avoid parsing lines in the common case where the lines are the same log type.
In fact you probably don't need to parse the timestamp at all, unless you have a line that doesn't have a leading timestamp you can directly compare two lines with leading timestamps, the timestamp text is fixed-width and lexically sortable already.
- % Done changed from 0 to 100
- Status changed from In Progress to Resolved
Also available in: Atom
PDF