Skip to content

refactor: separate graph_batch_size from parallel_batches (lanes) - #220

Merged
NityamPareek merged 2 commits into
exchange-litigation-holdfrom
eo-decouple-parallel-batches
Nov 17, 2026
Merged

NityamPareek merged 2 commits into
exchange-litigation-holdfrom
eo-decouple-parallel-batches

Conversation

@NityamPareek

@NityamPareek NityamPareek commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Part 1 of 7 of the Exchange Recoverable Items (litigation hold) work. Targets the exchange-litigation-hold integration branch.

Problem

ScanConfig.parallel_batches had two meanings:

  • Lanes: the "Parallel Batches" UI slider (number of parallel migration plan lanes).
  • Graph $batch size: the EO and Files estimators passed it to create_batches as the number of sub-requests per Microsoft Graph $batch call.

In the Exchange planner, moving the lanes slider therefore silently changed scan batching (e.g. a value of 1 sent one request per $batch). The Files planner worked around this by forcing config.parallel_batches = 10.

Change

  • util/constants.py: new DEFAULT_GRAPH_BATCH_SIZE = 10.
  • util/utils.py: new ScanConfig.graph_batch_size (default 10). ScanConfig.parallel_batches now only means lanes.
  • EO estimators (email, in-place archive, group, shared mailbox) and file_estimator.py: create_batches uses config.graph_batch_size (22 call sites).
  • ui/exchange_online_ui.py: still passes the slider as parallel_batches (lanes); the $batch size comes from the new default.
  • ui/files_ui.py: removed the config.parallel_batches = 10 override. It is no longer needed, and Files lanes keep using val_parallel_batches.
  • Tests that set the $batch size now use graph_batch_size with the same values.

Impact

Planner Before After
Exchange $batch size = slider value $batch size = 10; slider controls lanes only
Files $batch size forced to 10 $batch size = 10 (no behaviour change)
Chat parallel_batches = lanes Unchanged

Unchanged: child-folder crawls still use hierarchial_crawl_batch_limit (4). The shallow file estimator and chat estimator don't call create_batches.

Testing

  • Offline suites pass (188 tests): files batch planner / shallow / versions / license fetch, chat, EO in-place archive / shared / group mailbox sanity tests.
  • Load tests were not run to completion.
The "Parallel Batches" slider is meant to control migration plan lanes
only, but its value was also passed as ScanConfig.parallel_batches,
which the EO estimators use as the Graph $batch sub-request count.
Use a dedicated GRAPH_BATCH_REQUEST_SIZE constant (10, the previous
default) for scanning; lanes still read the slider directly.
ScanConfig.parallel_batches now only denotes the number of parallel
migration plan lanes (the UI slider). The number of sub-requests per
Graph $batch call moves to a new ScanConfig.graph_batch_size field
(default DEFAULT_GRAPH_BATCH_SIZE = 10).

- EO and Files estimators read config.graph_batch_size for create_batches.
- Exchange UI passes the slider value as parallel_batches again.
- Files UI drops its parallel_batches = 10 override, which only existed
  to keep the slider out of the $batch size.
- Tests that set the $batch size use graph_batch_size.
@NityamPareek NityamPareek changed the title fix(exchange): decouple Parallel Batches slider from Graph $batch size Nov 17, 2026
@NityamPareek
NityamPareek merged commit 7389a97 into exchange-litigation-hold Nov 17, 2026
1 check passed
@NityamPareek
NityamPareek deleted the eo-decouple-parallel-batches branch November 17, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant