1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
| 测试多个 DuckDB 实例并发操作...
开始并发读写操作... 线程1: 开始写入数据到 database_a.duckdb 线程2: 开始写入数据到 database_b.duckdb 线程3: 开始写入数据到 database_c.duckdb 读取任务1: 读取数据库A- 第1次尝试: 读取任务2: 读取数据库B - 第1次尝试: 读取任务1: 读取失败 - IO Error: Cannot open file "database_a.duckdb": ��һ����������ʹ�ô��ļ������������ʡ�
File is already open in D:\RustProject\swan-lake\Playground\parallel-duckdb-write\target\debug\parallel-duckdb-write.exe (PID 22848) 读取任务2: 读取失败 - IO Error: Cannot open file "database_b.duckdb": ��һ����������ʹ�ô��ļ������������ʡ�
File is already open in D:\RustProject\swan-lake\Playground\parallel-duckdb-write\target\debug\parallel-duckdb-write.exe (PID 22848) 线程2: 成功写入5条记录到 orders 表 (database_b.duckdb) 线程1: 成功写入5条记录到 products 表 (database_a.duckdb) 线程3: 成功写入5条记录到 users 表 (database_c.duckdb) 读取任务1: 读取数据库A- 第2次尝试: 读取 products (database_a.duckdb): ID: 1, Name: Item_1_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.241+00 ID: 2, Name: Item_2_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.354+00 ID: 3, Name: Item_3_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.464+00 ID: 4, Name: Item_4_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.572+00 ID: 5, Name: Item_5_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.681+00 读取任务1: 读取成功 线程4: 开始第二轮写入数据到 database_a.duckdb 读取任务2: 读取数据库B - 第2次尝试: 读取 orders (database_b.duckdb): ID: 1, Name: Item_1_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.249+00 ID: 2, Name: Item_2_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.357+00 ID: 3, Name: Item_3_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.464+00 ID: 4, Name: Item_4_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.572+00 ID: 5, Name: Item_5_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.681+00 读取任务2: 读取成功 读取任务1: 读取数据库A- 第3次尝试: 读取任务1: 读取失败 - IO Error: Cannot open file "database_a.duckdb": ��һ����������ʹ�ô��ļ������������ʡ�
File is already open in D:\RustProject\swan-lake\Playground\parallel-duckdb-write\target\debug\parallel-duckdb-write.exe (PID 22848) 线程4: 成功写入5条记录到 products 表 (database_a.duckdb) 读取任务2: 读取数据库B - 第3次尝试: 读取 orders (database_b.duckdb): ID: 1, Name: Item_1_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.249+00 ID: 2, Name: Item_2_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.357+00 ID: 3, Name: Item_3_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.464+00 ID: 4, Name: Item_4_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.572+00 ID: 5, Name: Item_5_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.681+00 读取任务2: 读取成功 读取任务1: 读取数据库A- 第4次尝试: 读取 products (database_a.duckdb): ID: 1, Name: Item_1_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.241+00 ID: 2, Name: Item_2_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.354+00 ID: 3, Name: Item_3_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.464+00 ID: 4, Name: Item_4_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.572+00 ID: 5, Name: Item_5_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.681+00 ID: 1, Name: Item_1_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.02+00 ID: 2, Name: Item_2_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.135+00 ID: 3, Name: Item_3_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.249+00 ID: 4, Name: Item_4_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.357+00 ID: 5, Name: Item_5_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.465+00 读取任务1: 读取成功 读取任务2: 读取数据库B - 第4次尝试: 读取 orders (database_b.duckdb): ID: 1, Name: Item_1_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.249+00 ID: 2, Name: Item_2_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.357+00 ID: 3, Name: Item_3_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.464+00 ID: 4, Name: Item_4_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.572+00 ID: 5, Name: Item_5_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.681+00 读取任务2: 读取成功 读取任务1: 读取数据库A- 第5次尝试: 读取 products (database_a.duckdb): ID: 1, Name: Item_1_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.241+00 ID: 2, Name: Item_2_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.354+00 ID: 3, Name: Item_3_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.464+00 ID: 4, Name: Item_4_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.572+00 ID: 5, Name: Item_5_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.681+00 ID: 1, Name: Item_1_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.02+00 ID: 2, Name: Item_2_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.135+00 ID: 3, Name: Item_3_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.249+00 ID: 4, Name: Item_4_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.357+00 ID: 5, Name: Item_5_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.465+00 读取任务1: 读取成功 读取任务1: 读取数据库A- 第6次尝试: 读取任务2: 读取数据库B - 第5次尝试: 读取 products (database_a.duckdb): ID: 1, Name: Item_1_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.241+00 ID: 2, Name: Item_2_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.354+00 ID: 3, Name: Item_3_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.464+00 ID: 4, Name: Item_4_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.572+00 ID: 5, Name: Item_5_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.681+00 ID: 1, Name: Item_1_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.02+00 ID: 2, Name: Item_2_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.135+00 ID: 3, Name: Item_3_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.249+00 ID: 4, Name: Item_4_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.357+00 ID: 5, Name: Item_5_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.465+00 读取任务1: 读取成功 读取 orders (database_b.duckdb): ID: 1, Name: Item_1_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.249+00 ID: 2, Name: Item_2_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.357+00 ID: 3, Name: Item_3_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.464+00 ID: 4, Name: Item_4_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.572+00 ID: 5, Name: Item_5_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.681+00 读取任务2: 读取成功 读取任务1: 读取数据库A- 第7次尝试: 读取 products (database_a.duckdb): ID: 1, Name: Item_1_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.241+00 ID: 2, Name: Item_2_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.354+00 ID: 3, Name: Item_3_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.464+00 ID: 4, Name: Item_4_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.572+00 ID: 5, Name: Item_5_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.681+00 ID: 1, Name: Item_1_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.02+00 ID: 2, Name: Item_2_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.135+00 ID: 3, Name: Item_3_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.249+00 ID: 4, Name: Item_4_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.357+00 ID: 5, Name: Item_5_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.465+00 读取任务1: 读取成功 读取任务2: 读取数据库B - 第6次尝试: 读取 orders (database_b.duckdb): ID: 1, Name: Item_1_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.249+00 ID: 2, Name: Item_2_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.357+00 ID: 3, Name: Item_3_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.464+00 ID: 4, Name: Item_4_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.572+00 ID: 5, Name: Item_5_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.681+00 读取任务2: 读取成功 读取任务1: 读取数据库A- 第8次尝试: 读取 products (database_a.duckdb): ID: 1, Name: Item_1_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.241+00 ID: 2, Name: Item_2_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.354+00 ID: 3, Name: Item_3_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.464+00 ID: 4, Name: Item_4_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.572+00 ID: 5, Name: Item_5_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.681+00 ID: 1, Name: Item_1_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.02+00 ID: 2, Name: Item_2_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.135+00 ID: 3, Name: Item_3_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.249+00 ID: 4, Name: Item_4_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.357+00 ID: 5, Name: Item_5_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.465+00 读取任务1: 读取成功 读取任务2: 读取数据库B - 第7次尝试: 读取 orders (database_b.duckdb): ID: 1, Name: Item_1_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.249+00 ID: 2, Name: Item_2_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.357+00 ID: 3, Name: Item_3_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.464+00 ID: 4, Name: Item_4_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.572+00 ID: 5, Name: Item_5_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.681+00 读取任务2: 读取成功 读取任务1: 读取数据库A- 第9次尝试: 读取 products (database_a.duckdb): ID: 1, Name: Item_1_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.241+00 ID: 2, Name: Item_2_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.354+00 ID: 3, Name: Item_3_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.464+00 ID: 4, Name: Item_4_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.572+00 ID: 5, Name: Item_5_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.681+00 ID: 1, Name: Item_1_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.02+00 ID: 2, Name: Item_2_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.135+00 ID: 3, Name: Item_3_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.249+00 ID: 4, Name: Item_4_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.357+00 ID: 5, Name: Item_5_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.465+00 读取任务1: 读取成功 读取任务1: 读取数据库A- 第10次尝试: 读取任务2: 读取数据库B - 第8次尝试: 读取 orders (database_b.duckdb): 读取 products (database_a.duckdb): ID: 1, Name: Item_1_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.249+00 ID: 2, Name: Item_2_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.357+00 ID: 1, Name: Item_1_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.241+00 ID: 3, Name: Item_3_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.464+00 ID: 2, Name: Item_2_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.354+00 ID: 4, Name: Item_4_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.572+00 ID: 3, Name: Item_3_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.464+00 ID: 4, Name: Item_4_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.572+00 ID: 5, Name: Item_5_from_thread_2, Thread: 2, Time: 2025-07-30 15:49:27.681+00 ID: 5, Name: Item_5_from_thread_1, Thread: 1, Time: 2025-07-30 15:49:27.681+00 ID: 1, Name: Item_1_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.02+00 ID: 2, Name: Item_2_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.135+00 ID: 3, Name: Item_3_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.249+00 ID: 4, Name: Item_4_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.357+00 ID: 5, Name: Item_5_from_thread_4, Thread: 4, Time: 2025-07-30 15:49:28.465+00 读取任务2: 读取成功 读取任务1: 读取成功
测试结束
|