Skip to content

Commit 80740d0

Browse files
duckdblabs-botgithub-actions[bot]
authored andcommitted
Update vendored DuckDB sources to 7fba13fbe1
1 parent 1c9c750 commit 80740d0

5 files changed

Lines changed: 28 additions & 37 deletions

File tree

src/duckdb/src/function/table/version/pragma_version.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef DUCKDB_PATCH_VERSION
2-
#define DUCKDB_PATCH_VERSION "5-dev13"
2+
#define DUCKDB_PATCH_VERSION "5-dev17"
33
#endif
44
#ifndef DUCKDB_MINOR_VERSION
55
#define DUCKDB_MINOR_VERSION 4
@@ -8,10 +8,10 @@
88
#define DUCKDB_MAJOR_VERSION 1
99
#endif
1010
#ifndef DUCKDB_VERSION
11-
#define DUCKDB_VERSION "v1.4.5-dev13"
11+
#define DUCKDB_VERSION "v1.4.5-dev17"
1212
#endif
1313
#ifndef DUCKDB_SOURCE_ID
14-
#define DUCKDB_SOURCE_ID "32a088ad40"
14+
#define DUCKDB_SOURCE_ID "7fba13fbe1"
1515
#endif
1616
#include "duckdb/function/table/system_functions.hpp"
1717
#include "duckdb/main/database.hpp"

src/duckdb/src/include/duckdb/transaction/duck_transaction_manager.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ class DuckTransactionManager : public TransactionManager {
9494
//! Whether or not we can checkpoint
9595
CheckpointDecision CanCheckpoint(DuckTransaction &transaction, unique_ptr<StorageLockKey> &checkpoint_lock,
9696
const UndoBufferProperties &properties);
97+
void CleanupTransactions();
9798

9899
private:
99100
//! The current start timestamp used by transactions

src/duckdb/src/storage/local_storage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,6 @@ void LocalStorage::Flush(DataTable &table, LocalTableStorage &storage, optional_
595595

596596
TableAppendState append_state;
597597
table.AppendLock(append_state);
598-
transaction.PushAppend(table, NumericCast<idx_t>(append_state.row_start), append_count);
599598
if ((append_state.row_start == 0 || storage.row_groups->GetTotalRows() >= row_group_size) &&
600599
storage.deleted_rows == 0) {
601600
// table is currently empty OR we are bulk appending: move over the storage directly
@@ -615,6 +614,7 @@ void LocalStorage::Flush(DataTable &table, LocalTableStorage &storage, optional_
615614
// append to the indexes and append to the base table
616615
storage.AppendToIndexes(transaction, append_state, true);
617616
}
617+
transaction.PushAppend(table, NumericCast<idx_t>(append_state.row_start), append_count);
618618

619619
#ifdef DEBUG
620620
// Verify that our index memory is stable.

src/duckdb/src/storage/table/standard_column_data.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,8 @@ void StandardColumnData::Update(TransactionData transaction, DataTable &data_tab
156156
Vector &update_vector, row_t *row_ids, idx_t update_count) {
157157
ColumnScanState standard_state, validity_state;
158158
Vector base_vector(type);
159-
auto standard_fetch = FetchUpdateData(standard_state, row_ids, base_vector);
160-
auto validity_fetch = validity.FetchUpdateData(validity_state, row_ids, base_vector);
161-
if (standard_fetch != validity_fetch) {
162-
throw InternalException("Unaligned fetch in validity and main column data for update");
163-
}
159+
FetchUpdateData(standard_state, row_ids, base_vector);
160+
validity.FetchUpdateData(validity_state, row_ids, base_vector);
164161

165162
UpdateInternal(transaction, data_table, column_index, update_vector, row_ids, update_count, base_vector);
166163
validity.UpdateInternal(transaction, data_table, column_index, update_vector, row_ids, update_count, base_vector);

src/duckdb/src/transaction/duck_transaction_manager.cpp

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,25 @@ transaction_t DuckTransactionManager::GetCommitTimestamp() {
233233
return commit_ts;
234234
}
235235

236+
void DuckTransactionManager::CleanupTransactions() {
237+
lock_guard<mutex> c_lock(cleanup_lock);
238+
while (true) {
239+
unique_ptr<DuckCleanupInfo> top_cleanup_info;
240+
{
241+
lock_guard<mutex> q_lock(cleanup_queue_lock);
242+
if (cleanup_queue.empty()) {
243+
// all transactions have been cleaned up - done
244+
return;
245+
}
246+
top_cleanup_info = std::move(cleanup_queue.front());
247+
cleanup_queue.pop();
248+
}
249+
if (top_cleanup_info) {
250+
top_cleanup_info->Cleanup();
251+
}
252+
}
253+
}
254+
236255
ErrorData DuckTransactionManager::CommitTransaction(ClientContext &context, Transaction &transaction_p) {
237256
auto &transaction = transaction_p.Cast<DuckTransaction>();
238257
unique_lock<mutex> t_lock(transaction_lock);
@@ -327,20 +346,7 @@ ErrorData DuckTransactionManager::CommitTransaction(ClientContext &context, Tran
327346
// as they (1) have been removed, or (2) exited old_transactions.
328347
t_lock.unlock();
329348

330-
{
331-
lock_guard<mutex> c_lock(cleanup_lock);
332-
unique_ptr<DuckCleanupInfo> top_cleanup_info;
333-
{
334-
lock_guard<mutex> q_lock(cleanup_queue_lock);
335-
if (!cleanup_queue.empty()) {
336-
top_cleanup_info = std::move(cleanup_queue.front());
337-
cleanup_queue.pop();
338-
}
339-
}
340-
if (top_cleanup_info) {
341-
top_cleanup_info->Cleanup();
342-
}
343-
}
349+
CleanupTransactions();
344350

345351
// now perform a checkpoint if (1) we are able to checkpoint, and (2) the WAL has reached sufficient size to
346352
// checkpoint
@@ -379,20 +385,7 @@ void DuckTransactionManager::RollbackTransaction(Transaction &transaction_p) {
379385
}
380386
}
381387

382-
{
383-
lock_guard<mutex> c_lock(cleanup_lock);
384-
unique_ptr<DuckCleanupInfo> top_cleanup_info;
385-
{
386-
lock_guard<mutex> q_lock(cleanup_queue_lock);
387-
if (!cleanup_queue.empty()) {
388-
top_cleanup_info = std::move(cleanup_queue.front());
389-
cleanup_queue.pop();
390-
}
391-
}
392-
if (top_cleanup_info) {
393-
top_cleanup_info->Cleanup();
394-
}
395-
}
388+
CleanupTransactions();
396389

397390
if (error.HasError()) {
398391
throw FatalException("Failed to rollback transaction. Cannot continue operation.\nError: %s", error.Message());

0 commit comments

Comments
 (0)