René Zeidler created NIFI-14254:
-----------------------------------
Summary: Provenance Event sorting by Event Time broken in
clustered environment
Key: NIFI-14254
URL: https://issues.apache.org/jira/browse/NIFI-14254
Project: Apache NiFi
Issue Type: Bug
Components: Core UI
Affects Versions: 2.2.0
Environment: N/A
Reporter: René Zeidler
Attachments: image-2025-02-10-10-07-31-585.png,
image-2025-02-10-10-22-42-176.png
h1. Summary
Provenance events should be sorted by timestamp, but in a clustered environment
they are often jumbled together:
!image-2025-02-10-10-22-42-176.png!
The order is correct for the events of each node separately, but is incorrect
overall.
h1. Cause
The issue is with this line:
[https://github.com/apache/nifi/blob/6dee8dfae5a177bea06e2b71b8f303b462e8ac32/nifi-frontend/src/main/frontend/apps/nifi/src/app/pages/provenance/ui/provenance-event-listing/provenance-event-table/provenance-event-table.component.ts#L264-L268]
The comment says:
{quote}// event ideas are increasing, so we can use this simple number for
sorting purposes
// since we don't surface the timestamp as millis
{quote}
But this assumption is incorrect. These are the objects for the above events:
!image-2025-02-10-10-07-31-585.png!
The eventIds are local to each node, so they cannot be used for sorting events
from multiple nodes.
The eventTime is returned as a formatted string, which is not ideal for sorting
either. Since the date format is MM/DD/YYYY (why?), sorting by that string
would work unless the events span more than 1 year (which is very unlikely for
provenance events).
However, it would be much nicer if the date was ISO formatted, or better,
returned as a Unix timestamp that's formatted in the UI.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)