Skip to content

Paginate execution history with cursors, indexed in the logging service - #826

Open
bugy wants to merge 1 commit into
masterfrom
history-pagination-cursor
Open

Paginate execution history with cursors, indexed in the logging service#826
bugy wants to merge 1 commit into
masterfrom
history-pagination-cursor

Conversation

@bugy

@bugy bugy commented Aug 5, 2026

Copy link
Copy Markdown
Owner

No description provided.

Alternative to #824. History and admin logs no longer load every entry at
once, but the paging happens inside ExecutionLoggingService rather than in
the request handler, and it is cursor-based rather than offset-based.

_renew_files_cache already parsed every log file exactly once and discarded
the result, while get_history_entries re-opened and re-parsed all of them on
every request. Keeping what was already computed removes that re-parse:
_ids_to_file_map (id -> filename) becomes _logs_by_id (id -> filename +
summary), so there is one index rather than two.

The summary omits command and output_format - command is the one unbounded
field in a log header, and both are only needed by the detail view, which
reads that single file anyway. The index is populated in start_logging,
where those values are already in hand, so executions started in the current
process are visible in history immediately.

Paging uses a (sort value, id) cursor, which is stable while new executions
are being appended; total is still returned, since it is just a counter on
the filter pass. Search and sorting moved to the server along with paging -
once only one page is shipped, a client-side search box silently searches
the visible page only.

GET history/execution_log/short now accepts limit, after, search, sort and
order, and always answers {records, total, nextCursor}. The Status column is
no longer sortable: it depends on live "is running" state, which the index
does not hold.
@bugy

bugy commented Aug 5, 2026

Copy link
Copy Markdown
Owner Author

Hi @cpadlab inspired by your PR, I propse the similar functionality but implemented slightly differently
Could you check if this works well for your setup?

It also moves search/sort functionality to BE, so we don't have to load everything on the FE.

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.

1 participant