# Combining reservoir samples across storage servers A bounded reservoir represents every eligible event processed, not just the records still retained. Equal-sized retained buffers can represent very different request populations. ## Exact constructed examples Two servers contribute 2 and 6 requests respectively. Every A request takes 100 ms; every B request takes 1 ms. Each local reservoir and the final sample hold 2 event occurrences. Uniformly pooling the retained records produces an expected sample mean of 50.5 ms; uniform sampling of all 8 requests gives 25.75 ms. These are expectations over all sampling choices, not measurements. For equal populations of 4 requests each, the same naive procedure gives every event the correct inclusion probability 1/4. Nevertheless a particular same-server pair has probability 1/36 and a cross-server pair 1/24, whereas uniform sampling requires 1/28 for every pair. The mean is correct but its sampling variance is different. ## Reproduce Python 3.10+ and its standard library suffice. Extract the ZIP and run these commands in its reservoir-merge directory: ```sh python3 -B model.py --check python3 -B -m unittest -v test_model.py python3 -B -O -m unittest -v test_model.py ``` The JSON retains all 28 pairs per case, four probability laws, exact rational inclusion probabilities, sample-mean expectations and variances. MANIFEST.json records SHA-256 hashes for each payload file. No network access, random seed or third-party package is required. ## Why count-aware allocation works For disjoint populations of sizes N_A and N_B and output size k, choose x A events with probability C(N_A,x) C(N_B,k-x) / C(N_A+N_B,k). Then subsample x events uniformly from A's reservoir and k-x from B's. Each local reservoir must be an independent uniform subset and retain at least min(k,N_i) events. For a fixed output subset containing x A events, the two component selection probabilities are 1/C(N_A,x) and 1/C(N_B,k-x). Multiplying them by the allocation probability leaves 1/C(N_A+N_B,k). This is a standard counting construction. Counts cannot recover discarded pairs when a local reservoir is too small. The model rejects that case rather than silently changing the sampling law. It also rejects overlapping represented event IDs. Real retained samples cannot establish that their original populations were disjoint. ## Scope This is exact finite-population enumeration, not Monte Carlo, a storage benchmark or an implementation of Apache DataSketches. No library defect is alleged. Apache documents count-aware unions and explicitly distinguishes their guarantees from single-stream sampling; see sources.json. Equal latency values from distinct requests remain separate observations. Request-weighted means and equal-host means answer different questions. Window identity, reset epoch, timing boundary and exact eligible counts must be preserved. Replaying a reservoir is not idempotent set union. Sampling recorded completions cannot restore timeouts or work omitted before sampling. No population confidence interval or p99 precision claim follows from these small examples. The tests check distributional, not seeded-output, agreement. Explanation: https://hesela.com/analyses/storage-latency-coordinated-omission/#reservoir-merge Definition: https://hesela.dev/terms/sampling-design/