@@ -95,6 +95,7 @@ func setupProcessorPartitionMigrator(ctx context.Context,
9595 gwBuffRWHandle := jobsdb .NewForReadWrite (
9696 "gw_buf" ,
9797 jobsdb .WithClearDB (false ),
98+ jobsdb .WithDefaultSkipStatusCompaction (true ), // no failed job statuses in gw_buf jobsdb
9899 jobsdb .WithDSLimit (config .GetReloadableIntVar (0 , 1 , "JobsDB.gw_buf.dsLimit" , "JobsDB.dsLimit" )),
99100 jobsdb .WithSkipMaintenanceErr (config .GetBoolVar (true , "JobsDB.gw_buf.skipMaintenanceError" , "JobsDB.buff.skipMaintenanceError" , "JobsDB.skipMaintenanceError" )),
100101 jobsdb .WithStats (stats ),
@@ -115,6 +116,7 @@ func setupProcessorPartitionMigrator(ctx context.Context,
115116 gwWODB = jobsdb .NewForWrite (
116117 "gw" ,
117118 jobsdb .WithClearDB (false ),
119+ jobsdb .WithDefaultSkipStatusCompaction (true ), // no failed job statuses in gw jobsdb
118120 jobsdb .WithStats (stats ),
119121 jobsdb .WithDBHandle (dbPool ),
120122 jobsdb .WithPriorityPoolDB (priorityPool ),
@@ -123,6 +125,7 @@ func setupProcessorPartitionMigrator(ctx context.Context,
123125 )
124126 gwBuffROHandle := jobsdb .NewForRead (
125127 "gw_buf" ,
128+ jobsdb .WithDefaultSkipStatusCompaction (true ), // no failed job statuses in gw_buf jobsdb
126129 jobsdb .WithDSLimit (config .GetReloadableIntVar (0 , 1 , "JobsDB.gw_buf.dsLimit" , "JobsDB.dsLimit" )),
127130 jobsdb .WithSkipMaintenanceErr (config .GetBoolVar (true , "JobsDB.gw_buf.skipMaintenanceError" , "JobsDB.buff.skipMaintenanceError" , "JobsDB.skipMaintenanceError" )),
128131 jobsdb .WithStats (stats ),
@@ -153,6 +156,7 @@ func setupProcessorPartitionMigrator(ctx context.Context,
153156 rtBuffRWHandle := jobsdb .NewForReadWrite (
154157 "rt_buf" ,
155158 jobsdb .WithClearDB (false ),
159+ jobsdb .WithDefaultSkipStatusCompaction (true ), // no failed job statuses in rt_buf jobsdb
156160 jobsdb .WithDSLimit (config .GetReloadableIntVar (0 , 1 , "JobsDB.rt_buff.dsLimit" , "JobsDB.dsLimit" )),
157161 jobsdb .WithSkipMaintenanceErr (config .GetBoolVar (true , "JobsDB.rt_buff.skipMaintenanceError" , "JobsDB.buff.skipMaintenanceError" , "JobsDB.skipMaintenanceError" )),
158162 jobsdb .WithStats (stats ),
@@ -180,6 +184,7 @@ func setupProcessorPartitionMigrator(ctx context.Context,
180184 brtBuffRWHandle := jobsdb .NewForReadWrite (
181185 "batch_rt_buf" ,
182186 jobsdb .WithClearDB (false ),
187+ jobsdb .WithDefaultSkipStatusCompaction (true ), // no failed job statuses in batch_rt_buf jobsdb
183188 jobsdb .WithDSLimit (config .GetReloadableIntVar (0 , 1 , "JobsDB.batch_rt_buff.dsLimit" , "JobsDB.dsLimit" )),
184189 jobsdb .WithSkipMaintenanceErr (config .GetBoolVar (true , "JobsDB.batch_rt_buff.skipMaintenanceError" , "JobsDB.buff.skipMaintenanceError" , "JobsDB.skipMaintenanceError" )),
185190 jobsdb .WithStats (stats ),
@@ -208,7 +213,10 @@ func setupProcessorPartitionMigrator(ctx context.Context,
208213 if procRWDB != nil {
209214 procBuffRWHandle := jobsdb .NewForReadWrite (
210215 "proc_buf" ,
216+ // proc_buf doesn't need to be multi-consumer because it is used only as a temporary storage.
217+ // During flush, a single consumer will move the jobs to the proc jobsdb which is multi-consumer.
211218 jobsdb .WithClearDB (false ),
219+ jobsdb .WithDefaultSkipStatusCompaction (true ), // no failed job statuses in proc_buf jobsdb
212220 jobsdb .WithDSLimit (config .GetReloadableIntVar (0 , 1 , "JobsDB.proc_buf.dsLimit" , "JobsDB.dsLimit" )),
213221 jobsdb .WithSkipMaintenanceErr (config .GetBoolVar (true , "JobsDB.proc_buf.skipMaintenanceError" , "JobsDB.buff.skipMaintenanceError" , "JobsDB.skipMaintenanceError" )),
214222 jobsdb .WithStats (stats ),
@@ -347,6 +355,7 @@ func setupGatewayPartitionMigrator(ctx context.Context,
347355 gwBuffWOHandle := jobsdb .NewForWrite (
348356 "gw_buf" ,
349357 jobsdb .WithClearDB (false ),
358+ jobsdb .WithDefaultSkipStatusCompaction (true ), // no failed job statuses in gw_buf jobsdb
350359 jobsdb .WithSkipMaintenanceErr (config .GetBoolVar (true , "JobsDB.gw_buf.skipMaintenanceError" , "JobsDB.buff.skipMaintenanceError" , "JobsDB.skipMaintenanceError" )),
351360 jobsdb .WithStats (stats ),
352361 jobsdb .WithDBHandle (dbPool ),
0 commit comments