Skip to content

Conversation

@hx235
Copy link
Contributor

@hx235 hx235 commented Dec 18, 2025

Context/Summary:
compaction_job_test does low level assertions on what keys were saved and to resume in 1e5fa69 before the integration of the feature is done in a separate PR f7e4009. Such low-level test makes it difficult to assert data correctness, is hard to understand by being tied to implementation details.

Therefore they are now replaced with db-level tests with data correctness check, which is what we ultimately care out of those details. I also expand the test to cover wide column and TimedPut() which associates a key with write time.

Test:

  • Only test change; I also manually traced every test to ensure correct resumption point; also remove
if (c_iter->IsCurrentKeyAlreadyScanned()) {
    return false;
  }

leads to the expected error with resumption at merge, single delete and deletion at bottom

@meta-cla meta-cla bot added the CLA Signed label Dec 18, 2025
}

if (!reader_status.ok()) {
return reader_status;
Copy link
Contributor Author

@hx235 hx235 Dec 18, 2025

Choose a reason for hiding this comment

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

To please ASSERT_STATUS_CHECK. Missing it (i.e, not entering the loop of compaction_progress_reader.ReadRecord(&slice, &record)) is not a bug because we have the blanket statement below if (progress_builder.HasAccumulatedSubcompactionProgress())

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if reader_status.PermitUncheckedError() would make more sense if the purpose of doing this is to please ASSERT_STATUS_CHECK

@meta-codesync
Copy link

meta-codesync bot commented Dec 18, 2025

@hx235 has imported this pull request. If you are a Meta employee, you can view this in D89492846.

@meta-codesync
Copy link

meta-codesync bot commented Dec 19, 2025

@hx235 has imported this pull request. If you are a Meta employee, you can view this in D89492846.

@hx235 hx235 requested a review from jaykorean December 19, 2025 00:55
// no progress file exists, so it cannot resume and must start from
// scratch, processing all input keys again. Result: Phase 3 does the
// same amount of work as Phase 1.
EXPECT_EQ(final_phase_stats.count, phase1_stats.count);
Copy link
Contributor

Choose a reason for hiding this comment

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

Not strictly related to this PR, but since you are improving the test.

IIUC, these stats are FILE_WRITE_COMPACTION_MICROS in RunCancelledCompaction() and RunCompaction(). Are they deterministic? I thought they were set by StopWatch. Asking for my own learning.

If they are not deterministic, I wonder if we want to use read/write bytes count instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants