feat: run shadow v3 without legacy waiting
This commit is contained in:
@@ -112,4 +112,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and state.synchronized_at = #{snapshotSynchronizedAt}
|
||||
and convert(varchar(64), state.source_signature, 2) = #{sourceSignature}
|
||||
</insert>
|
||||
|
||||
<update id="upsertRuntimeMetric">
|
||||
merge alg.shadow_runtime_metric with (holdlock) as target
|
||||
using (select #{warehouseId} as warehouse_id,
|
||||
#{metricName} as metric_name,
|
||||
#{bucketUpperMicros} as bucket_upper_micros) as source
|
||||
on target.warehouse_id = source.warehouse_id
|
||||
and target.metric_name = source.metric_name
|
||||
and target.bucket_upper_micros = source.bucket_upper_micros
|
||||
when matched then update set
|
||||
metric_count = target.metric_count + #{metricCount},
|
||||
metric_total_micros = target.metric_total_micros + #{metricTotalMicros},
|
||||
metric_max_micros = case when target.metric_max_micros > #{metricMaxMicros}
|
||||
then target.metric_max_micros else #{metricMaxMicros} end,
|
||||
flushed_at = #{flushedAt}
|
||||
when not matched then insert (
|
||||
warehouse_id, metric_name, bucket_upper_micros,
|
||||
metric_count, metric_total_micros, metric_max_micros, flushed_at)
|
||||
values (
|
||||
source.warehouse_id, source.metric_name, source.bucket_upper_micros,
|
||||
#{metricCount}, #{metricTotalMicros}, #{metricMaxMicros}, #{flushedAt});
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user