Skip to content

Commit dc63f45

Browse files
committed
fix: remove duplicate code left by main-merge auto-resolution
The merge of main into pr-b-cleanup-hardening auto-resolved by keeping both the new and old versions side-by-side in three places: * transaction.cc: duplicate Result<const TableMetadata*> finalize_result definition (compile error: redefinition). * expire_snapshots.cc: duplicate #include <string>. * expire_snapshots.cc: an old DeleteFile/DeleteFiles pair (the pre-hardening serial loop with the original "TODO add retry" comment) was kept inside the new DeleteFiles body, leaving an unmatched brace and two redefined methods. Drop the duplicates so the file compiles and matches the intended post-merge state. clang-format remains clean and all ExpireSnapshots tests pass.
1 parent 23b2a4e commit dc63f45

2 files changed

Lines changed: 0 additions & 24 deletions

File tree

src/iceberg/transaction.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,6 @@ Result<std::shared_ptr<Table>> Transaction::Commit() {
368368
? Result<const TableMetadata*>(commit_result.value()->metadata().get())
369369
: std::unexpected(commit_result.error());
370370

371-
Result<const TableMetadata*> finalize_result =
372-
commit_result.has_value()
373-
? Result<const TableMetadata*>(commit_result.value()->metadata().get())
374-
: std::unexpected(commit_result.error());
375-
376371
for (const auto& update : pending_updates_) {
377372
std::ignore = update->Finalize(finalize_result);
378373
}

src/iceberg/update/expire_snapshots.cc

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include <span>
3030
#include <string>
3131
#include <thread>
32-
#include <string>
3332
#include <unordered_set>
3433
#include <vector>
3534

@@ -185,24 +184,6 @@ class FileCleanupStrategy {
185184
std::vector<std::string> as_vec(paths.begin(), paths.end());
186185
RunInParallel<std::string>(std::span<const std::string>(as_vec),
187186
[this](const std::string& p) { DeleteFile(p); });
188-
/// \brief Delete a single file
189-
void DeleteFile(const std::string& path) {
190-
try {
191-
if (delete_func_) {
192-
delete_func_(path);
193-
} else {
194-
std::ignore = file_io_->DeleteFile(path);
195-
}
196-
} catch (...) {
197-
/// TODO(shangxinli): add retry
198-
}
199-
}
200-
201-
/// TODO(shangxinli): Add bulk deletion
202-
void DeleteFiles(const std::unordered_set<std::string>& paths) {
203-
for (const auto& path : paths) {
204-
DeleteFile(path);
205-
}
206187
}
207188

208189
bool HasAnyStatisticsFiles(const TableMetadata& metadata) const {

0 commit comments

Comments
 (0)