Skip to content

Commit 4720a24

Browse files
committed
vendor: Update vendored sources to duckdb/duckdb@ef253ee
Provide callback when tasks are starting / stopping (duckdb/duckdb#16451) [tests] Add allow_unsigned_extensions require (duckdb/duckdb#16499)
1 parent 9acb564 commit 4720a24

File tree

18 files changed

+106
-26
lines changed

18 files changed

+106
-26
lines changed

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 "1-dev241"
2+
#define DUCKDB_PATCH_VERSION "1-dev248"
33
#endif
44
#ifndef DUCKDB_MINOR_VERSION
55
#define DUCKDB_MINOR_VERSION 2
@@ -8,10 +8,10 @@
88
#define DUCKDB_MAJOR_VERSION 1
99
#endif
1010
#ifndef DUCKDB_VERSION
11-
#define DUCKDB_VERSION "v1.2.1-dev241"
11+
#define DUCKDB_VERSION "v1.2.1-dev248"
1212
#endif
1313
#ifndef DUCKDB_SOURCE_ID
14-
#define DUCKDB_SOURCE_ID "fba0ffea7e"
14+
#define DUCKDB_SOURCE_ID "ef253eea8e"
1515
#endif
1616
#include "duckdb/function/table/system_functions.hpp"
1717
#include "duckdb/main/database.hpp"

src/duckdb/src/include/duckdb/main/client_context_state.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ class ClientContextState {
8080
}
8181
virtual void WriteProfilingInformation(std::ostream &ss) {
8282
}
83+
virtual void OnTaskStart(ClientContext &context) {
84+
}
85+
virtual void OnTaskStop(ClientContext &context) {
86+
}
8387

8488
public:
8589
template <class TARGET>

src/duckdb/src/include/duckdb/parallel/executor_task.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
#pragma once
1010

1111
#include "duckdb/parallel/task.hpp"
12-
#include "duckdb/parallel/event.hpp"
1312
#include "duckdb/common/optional_ptr.hpp"
1413

1514
namespace duckdb {
15+
class Event;
1616
class PhysicalOperator;
1717
class ThreadContext;
1818

@@ -34,6 +34,9 @@ class ExecutorTask : public Task {
3434
unique_ptr<ThreadContext> thread_context;
3535
optional_ptr<const PhysicalOperator> op;
3636

37+
private:
38+
ClientContext &context;
39+
3740
public:
3841
virtual TaskExecutionResult ExecuteTask(TaskExecutionMode mode) = 0;
3942
TaskExecutionResult Execute(TaskExecutionMode mode) override;

src/duckdb/src/include/duckdb/parallel/pipeline.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
namespace duckdb {
2121

2222
class Executor;
23-
class Event;
2423
class MetaPipeline;
2524
class PipelineExecutor;
2625
class Pipeline;

src/duckdb/src/include/duckdb/parallel/task_executor.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include "duckdb/common/common.hpp"
1212
#include "duckdb/common/atomic.hpp"
13+
#include "duckdb/common/optional_ptr.hpp"
1314
#include "duckdb/parallel/task.hpp"
1415
#include "duckdb/execution/task_error_manager.hpp"
1516

@@ -47,6 +48,8 @@ class TaskExecutor {
4748
unique_ptr<ProducerToken> token;
4849
atomic<idx_t> completed_tasks;
4950
atomic<idx_t> total_tasks;
51+
friend class BaseExecutorTask;
52+
optional_ptr<ClientContext> context;
5053
};
5154

5255
class BaseExecutorTask : public Task {
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//===----------------------------------------------------------------------===//
2+
// DuckDB
3+
//
4+
// duckdb/parallel/task_notifier.hpp
5+
//
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#pragma once
10+
11+
#include "duckdb/common/optional_ptr.hpp"
12+
13+
namespace duckdb {
14+
class ClientContext;
15+
16+
//! The TaskNotifier notifies ClientContextState listener about started / stopped tasks
17+
class TaskNotifier {
18+
public:
19+
explicit TaskNotifier(optional_ptr<ClientContext> context_p);
20+
21+
~TaskNotifier();
22+
23+
private:
24+
optional_ptr<ClientContext> context;
25+
};
26+
27+
} // namespace duckdb

src/duckdb/src/include/duckdb/storage/checkpoint/table_data_writer.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class TableStatistics;
2323
//! Abstraction will support, for example: tiering, versioning, or splitting into multiple block managers.
2424
class TableDataWriter {
2525
public:
26-
explicit TableDataWriter(TableCatalogEntry &table);
26+
explicit TableDataWriter(TableCatalogEntry &table, optional_ptr<ClientContext> client_context);
2727
virtual ~TableDataWriter();
2828

2929
public:
@@ -39,9 +39,11 @@ class TableDataWriter {
3939

4040
TaskScheduler &GetScheduler();
4141
DatabaseInstance &GetDatabase();
42+
optional_ptr<ClientContext> GetClientContext();
4243

4344
protected:
4445
DuckTableEntry &table;
46+
optional_ptr<ClientContext> client_context;
4547
//! Pointers to the start of each row group.
4648
vector<RowGroupPointer> row_group_pointers;
4749
};

src/duckdb/src/include/duckdb/storage/checkpoint_manager.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ class SingleFileCheckpointWriter final : public CheckpointWriter {
9797
friend class SingleFileTableDataWriter;
9898

9999
public:
100-
SingleFileCheckpointWriter(AttachedDatabase &db, BlockManager &block_manager, CheckpointType checkpoint_type);
100+
SingleFileCheckpointWriter(optional_ptr<ClientContext> client_context, AttachedDatabase &db,
101+
BlockManager &block_manager, CheckpointType checkpoint_type);
101102

102103
//! Checkpoint the current state of the WAL and flush it to the main storage. This should be called BEFORE any
103104
//! connection is available because right now the checkpointing cannot be done online. (TODO)
@@ -112,10 +113,15 @@ class SingleFileCheckpointWriter final : public CheckpointWriter {
112113
return checkpoint_type;
113114
}
114115

116+
optional_ptr<ClientContext> GetClientContext() const {
117+
return client_context;
118+
}
119+
115120
public:
116121
void WriteTable(TableCatalogEntry &table, Serializer &serializer) override;
117122

118123
private:
124+
optional_ptr<ClientContext> client_context;
119125
//! The metadata writer is responsible for writing schema information
120126
unique_ptr<MetadataWriter> metadata_writer;
121127
//! The table data writer is responsible for writing the DataPointers used by the table chunks

src/duckdb/src/include/duckdb/storage/storage_manager.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ class StorageManager {
100100
virtual bool AutomaticCheckpoint(idx_t estimated_wal_bytes) = 0;
101101
virtual unique_ptr<StorageCommitState> GenStorageCommitState(WriteAheadLog &wal) = 0;
102102
virtual bool IsCheckpointClean(MetaBlockPointer checkpoint_id) = 0;
103-
virtual void CreateCheckpoint(CheckpointOptions options = CheckpointOptions()) = 0;
103+
virtual void CreateCheckpoint(optional_ptr<ClientContext> client_context,
104+
CheckpointOptions options = CheckpointOptions()) = 0;
104105
virtual DatabaseSize GetDatabaseSize() = 0;
105106
virtual vector<MetadataBlockInfo> GetMetadataInfo() = 0;
106107
virtual shared_ptr<TableIOManager> GetTableIOManager(BoundCreateTableInfo *info) = 0;
@@ -159,7 +160,7 @@ class SingleFileStorageManager : public StorageManager {
159160
bool AutomaticCheckpoint(idx_t estimated_wal_bytes) override;
160161
unique_ptr<StorageCommitState> GenStorageCommitState(WriteAheadLog &wal) override;
161162
bool IsCheckpointClean(MetaBlockPointer checkpoint_id) override;
162-
void CreateCheckpoint(CheckpointOptions options) override;
163+
void CreateCheckpoint(optional_ptr<ClientContext> client_context, CheckpointOptions options) override;
163164
DatabaseSize GetDatabaseSize() override;
164165
vector<MetadataBlockInfo> GetMetadataInfo() override;
165166
shared_ptr<TableIOManager> GetTableIOManager(BoundCreateTableInfo *info) override;

src/duckdb/src/main/attached_database.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ void AttachedDatabase::Close() {
247247
}
248248
CheckpointOptions options;
249249
options.wal_action = CheckpointWALAction::DELETE_WAL;
250-
storage->CreateCheckpoint(options);
250+
storage->CreateCheckpoint(nullptr, options);
251251
}
252252
} catch (...) { // NOLINT
253253
}

0 commit comments

Comments
 (0)