Skip to content

Comments

Move sender state into s3#374

Merged
Ian-Nara merged 17 commits intomainfrom
ian-UID2-6392-move-sender-state-to-s3
Feb 20, 2026
Merged

Move sender state into s3#374
Ian-Nara merged 17 commits intomainfrom
ian-UID2-6392-move-sender-state-to-s3

Conversation

@Ian-Nara
Copy link
Contributor

@Ian-Nara Ian-Nara commented Feb 16, 2026

OptOutLogTool.java: remove the empty-delta-file removal step from the cron job, since we no longer generate empty delta files.

The rest of the changes are to move the partner sender state from local storage into S3 storage. This includes a timestamp.txt file for each partner, which tracks the timestamp of the most recent delta sent to the partner, and a processed.txt file that lists the delta files already sent to the partner.

pom.xml Outdated
<groupId>com.uid2</groupId>
<artifactId>uid2-optout</artifactId>
<version>4.9.0</version>
<version>4.9.1-alpha-215-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will revert before merge

}

PartnerConfigMonitorV2 configMon = new PartnerConfigMonitorV2(vertx, config, fsMetadata, fsContent, eventCloudSyncDownloaded);
PartnerConfigMonitorV2 configMon = new PartnerConfigMonitorV2(vertx, config, fsMetadata, fsContent, eventCloudSyncDownloaded, fsOptOut);
Copy link
Contributor

Choose a reason for hiding this comment

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

curious, do we still need 2 versions of createPartnerConfigMonitor and PartnerConfigMonitor?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, only v2 is used since we retrieve from core. I will create a followup to remove the old class and config version.

this.lastProcessedTimestamp = readTimestampFromCloud();
this.lastEntrySent.set(this.lastProcessedTimestamp.getEpochSecond());

this.processedDeltas.clear();
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious, do we need the clear here, would it ever not be empty?
It implies if processedDeltas contains entries that are not in readProcessedDeltasFromCloud, we want to remove those.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, there is no reload/rescan so this is unnecessary and misleading, will remove.

// Step 3. purge (deleting empty deltas)
// Step 4. sync (sync again after delete)
// An OptOut CronJob performs the following tasks sequentially:
// Step 1. gc (delete expired delta/partition files from S3)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we delete partition files any more

// Step 7. sync (sync again after compact)
// Step 3. pack (compact deltas into partition)
// Step 4. push (upload partition, delete source deltas from S3)
// Step 5. sync (sync again after compact)
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the purpose of step 5 if the pod is going to be stateless?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removing 5, also moving step 2 to only if -pack

// returning name of the file that stores timestamp
public Path getTimestampFile() {
return this.timestampFile;
String getTimestampKey() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't appear to be used

// returning name of the file that stores processed deltas
public Path getProcessedDeltasFile() {
return this.processedDeltasFile;
String getProcessedDeltasKey() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't appear to be used

@Ian-Nara Ian-Nara merged commit 935daba into main Feb 20, 2026
4 checks passed
@Ian-Nara Ian-Nara deleted the ian-UID2-6392-move-sender-state-to-s3 branch February 20, 2026 17:51
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