Skip to content

Consume the ingestion topic from the earliest offset - #2808

Open
delthas wants to merge 2 commits into
development/9.6from
improvement/BB-848/pin-fromoffset-mongo-processor
Open

Consume the ingestion topic from the earliest offset#2808
delthas wants to merge 2 commits into
development/9.6from
improvement/BB-848/pin-fromoffset-mongo-processor

Conversation

@delthas

@delthas delthas commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

MongoQueueProcessor did not set fromOffset, so it inherited librdkafka's default latest: a message produced onto a partition with no committed offset while the group had no member — a rolling update, a crash-restart — is skipped forever once the replacement consumer resolves its start position.

BB-831 swept this defect class and left this consumer unpinned, as having "no known permanent-loss path". That does not hold. LogReader persists its own log position in Zookeeper and advances it after publishing a batch, and the ingestion snapshot phase runs once at source creation — so nothing re-reads that stretch of the raft log, and a skipped message means the object metadata is never ingested.

Pinned unconditionally rather than behind a D/R mode, since the D/R metadata sink reuses this processor and loses entries the same way. The permanent-loss argument, the group geometry and the replay-safety analysis are on BB-848.

The consumer options move into _getConsumerOptions() for unit coverage, following #2788.

Issue: BB-848

@bert-e

bert-e commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Hello delthas,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request.
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.68%. Comparing base (52b9510) to head (6dbeee7).
⚠️ Report is 1 commits behind head on development/9.5.

Additional details and impacted files

Impacted file tree graph

Files with missing lines Coverage Δ
extensions/mongoProcessor/MongoQueueProcessor.js 73.47% <100.00%> (+6.66%) ⬆️

... and 4 files with indirect coverage changes

Components Coverage Δ
Bucket Notification 80.27% <ø> (ø)
Core Library 81.45% <ø> (-0.50%) ⬇️
Ingestion 71.45% <100.00%> (+1.35%) ⬆️
Lifecycle 80.46% <ø> (ø)
Oplog Populator 85.83% <ø> (ø)
Replication 62.04% <ø> (+0.03%) ⬆️
Bucket Scanner 85.76% <ø> (ø)
@@                 Coverage Diff                 @@
##           development/9.5    #2808      +/-   ##
===================================================
- Coverage            75.76%   75.68%   -0.09%     
===================================================
  Files                  200      200              
  Lines                13922    13923       +1     
===================================================
- Hits                 10548    10537      -11     
- Misses                3364     3376      +12     
  Partials                10       10              
Flag Coverage Δ
api:retry 9.10% <0.00%> (-0.01%) ⬇️
api:routes 8.87% <0.00%> (-0.01%) ⬇️
bucket-scanner 85.76% <ø> (ø)
ft_test:queuepopulator 10.14% <0.00%> (-0.85%) ⬇️
ingestion 12.26% <0.00%> (-0.01%) ⬇️
lib 8.82% <0.00%> (-0.01%) ⬇️
lifecycle 19.29% <0.00%> (-0.01%) ⬇️
notification 1.02% <0.00%> (-0.01%) ⬇️
oplogPopulator 0.13% <0.00%> (-0.01%) ⬇️
replication 18.84% <0.00%> (-0.01%) ⬇️
unit 55.00% <100.00%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@scality scality deleted a comment from bert-e Aug 18, 2026
@bert-e

bert-e commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

@delthas delthas changed the title Pin the mongo-processor consumer to the earliest offset Consume the ingestion topic from the earliest offset Aug 18, 2026
@delthas
delthas force-pushed the improvement/BB-848/pin-fromoffset-mongo-processor branch from 6e46ce1 to a8b4b49 Compare August 18, 2026 15:52
Comment thread tests/functional/lib/BackbeatConsumer.js Outdated
@delthas
delthas force-pushed the improvement/BB-848/pin-fromoffset-mongo-processor branch from a8b4b49 to ada9705 Compare August 18, 2026 16:02
@delthas
delthas requested review from a team, DarkIsDude and francoisferrand August 18, 2026 16:49
@delthas
delthas force-pushed the improvement/BB-848/pin-fromoffset-mongo-processor branch from ada9705 to c865711 Compare August 18, 2026 18:29
Comment thread tests/unit/mongoProcessor/MongoQueueProcessor.spec.js
@bert-e

bert-e commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

The following reviewers are expecting changes from the author, or must review again:

@delthas
delthas force-pushed the improvement/BB-848/pin-fromoffset-mongo-processor branch 2 times, most recently from 7cd092f to 955e00b Compare August 19, 2026 10:06
@scality scality deleted a comment from bert-e Aug 19, 2026
@delthas
delthas requested a review from DarkIsDude August 19, 2026 12:07
@delthas
delthas changed the base branch from development/9.5 to development/9.1 August 19, 2026 12:08
@delthas
delthas changed the base branch from development/9.1 to development/9.5 August 19, 2026 12:08
@bert-e

bert-e commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

The following reviewers are expecting changes from the author, or must review again:

@scality scality deleted a comment from bert-e Aug 19, 2026
@scality scality deleted a comment from bert-e Aug 19, 2026

@francoisferrand francoisferrand left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may create another issue ? E.g. if an OOB location is created, then deleted, then another (OOB) location with the same name is created : I am not sure everything will be clean'ed up (topic, ...), could there be a risk that we re-ingest data from the previous location ?
→ Please double check impact of this architecture change.
→ Can you please check if we have some OOB design docs (here or in citadel), maybe this is discussed already and/or should be added there

note: this is mostly for D/R and not urgent, should land on dev/9.6 ?

Comment thread tests/unit/mongoProcessor/MongoQueueProcessor.spec.js Outdated
Comment thread tests/unit/mongoProcessor/MongoQueueProcessor.spec.js

@DarkIsDude DarkIsDude left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also have concern about the use describe by Francois 🙏

Comment thread tests/unit/mongoProcessor/MongoQueueProcessor.spec.js
Comment thread tests/unit/mongoProcessor/MongoQueueProcessor.spec.js Outdated
Comment thread tests/unit/mongoProcessor/MongoQueueProcessor.spec.js
@delthas

delthas commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Agree on development/9.6 (it just wasn't created when I opened the PR)

@delthas
delthas force-pushed the improvement/BB-848/pin-fromoffset-mongo-processor branch from 955e00b to 4b3d2d8 Compare August 19, 2026 16:56
@delthas

delthas commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

if an OOB location is created, then deleted, then another (OOB) location with the same name is created

Checked this. The ingestion topic and consumer group are fixed per Zenko instance rather than per location (backbeat-ingestion / backbeat-ingestion-group in the operator's config), so deleting and recreating a location never mints a fresh consumer group: the committed offsets persist and earliest is not consulted.

The populator does clean its own state per source — _closeLogState_removeReaderStatezkClient.removeRecur('<zookeeperPath>/<zenkoBucket>'), keyed per Zenko bucket, matching the /ingestion/<zenko_bucket>/logState/<RaftID>/logOffset path in the OOB design doc. So a recreated location re-ingests from scratch, but that is the populator producing new entries, which happens identically with latest. Likewise entries already sitting in the topic for a removed location are applied either way, since the group's offset is behind them. Neither is changed by this PR.

earliest only takes effect when the group has no committed offset: the first ever start (topic empty, so a no-op), or after offsets.retention.minutes — 7 days by default of the group being empty, i.e. the processor down that long while the populator keeps producing. There, latest skips everything produced during the outage and that metadata is lost permanently, since the populator's own logOffset has advanced past it; earliest replays the retained window instead and the processor's writes are idempotent. That is the case this change is for.

On docs: the OOB design doc exists in both places (docs/oob-s3-ring.md here, docs/design/out-of-band/oob-s3-ring.md in citadel — same document). It documents the populator's zookeeper log offset but says nothing about the mongo-processor's Kafka consumer offsets, so this is not covered today.

Move the BackbeatConsumer options built inline in start() into
_getConsumerOptions(), following GarbageCollector and #2788, and cover it:
one test on the configuration it maps into options, and one asserting
start() builds the consumer from it -- the options being right is only
useful if they are the ones actually handed over.

No behaviour change.

Issue: BB-848
The mongo-processor did not set fromOffset, so auto.offset.reset fell
back to librdkafka's default `latest`. BB-831 pinned the consumers where
such a loss is permanent and listed this one as having "no known
permanent-loss path" -- but LogReader persists its own log position in
Zookeeper and advances it after publishing a batch, and the ingestion
snapshot phase runs once at source creation, so nothing re-reads that
stretch of the raft log. A skipped message means the object metadata is
never ingested.

Set fromOffset to 'earliest' so such messages are processed late instead
of never. Pinned unconditionally, since the D/R metadata sink reuses this
processor and loses entries the same way -- see BB-848 for the
permanent-loss argument, the group geometry and the replay-safety
analysis.

Issue: BB-848
@delthas
delthas force-pushed the improvement/BB-848/pin-fromoffset-mongo-processor branch from 4b3d2d8 to 6dbeee7 Compare August 19, 2026 17:10
@scality scality deleted a comment from bert-e Aug 19, 2026
@bert-e

bert-e commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Request integration branches

Waiting for integration branch creation to be requested by the user.

To request integration branches, please comment on this pull request with the following command:

/create_integration_branches

Alternatively, the /approve and /create_pull_requests commands will automatically
create the integration branches.

@scality scality deleted a comment from bert-e Aug 19, 2026
@delthas
delthas changed the base branch from development/9.5 to development/9.6 August 20, 2026 08:52
@delthas

delthas commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Moved to 9.6.

this._mProducer.setupProducer(cb);
}

_getConsumerOptions() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed with the latest change, let's keep the change lean (introducing the function also de-couples the options from consumer, which creates a risk if reused and inheriting incorrect params)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code is cleaner and easier to read, IMO better to keep it but open to Thomas's opinion

@scality scality deleted a comment from bert-e Aug 20, 2026
@bert-e

bert-e commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

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.

4 participants