Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pipe: fix the issues of excessive stale PipeEventCommitter logs and missing PipeDataNodeRemainingEventAndTimeMetrics #14284

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import org.apache.iotdb.db.pipe.extractor.dataregion.realtime.PipeRealtimeDataRegionHybridExtractor;
import org.apache.iotdb.db.pipe.extractor.dataregion.realtime.PipeRealtimeDataRegionLogExtractor;
import org.apache.iotdb.db.pipe.extractor.dataregion.realtime.PipeRealtimeDataRegionTsFileExtractor;
import org.apache.iotdb.db.pipe.metric.PipeDataNodeRemainingEventAndTimeMetrics;
import org.apache.iotdb.db.pipe.metric.PipeDataRegionExtractorMetrics;
import org.apache.iotdb.db.storageengine.StorageEngine;
import org.apache.iotdb.db.storageengine.dataregion.wal.utils.WALMode;
Expand Down Expand Up @@ -552,6 +553,7 @@ public void customize(

// register metric after generating taskID
PipeDataRegionExtractorMetrics.getInstance().register(this);
PipeDataNodeRemainingEventAndTimeMetrics.getInstance().register(this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.iotdb.commons.pipe.agent.task.progress.PipeEventCommitManager;
import org.apache.iotdb.commons.service.metric.enums.Metric;
import org.apache.iotdb.commons.service.metric.enums.Tag;
import org.apache.iotdb.db.pipe.extractor.dataregion.IoTDBDataRegionExtractor;
import org.apache.iotdb.db.pipe.extractor.schemaregion.IoTDBSchemaRegionExtractor;
import org.apache.iotdb.metrics.AbstractMetricService;
import org.apache.iotdb.metrics.metricsets.IMetricSet;
Expand Down Expand Up @@ -118,6 +119,19 @@ private void removeAutoGauge(final String pipeID) {

//////////////////////////// register & deregister (pipe integration) ////////////////////////////

public void register(final IoTDBDataRegionExtractor extractor) {
// The metric is global thus the regionId is omitted
final String pipeID = extractor.getPipeName() + "_" + extractor.getCreationTime();
remainingEventAndTimeOperatorMap.computeIfAbsent(
pipeID,
k ->
new PipeDataNodeRemainingEventAndTimeOperator(
extractor.getPipeName(), extractor.getCreationTime()));
if (Objects.nonNull(metricService)) {
createMetrics(pipeID);
}
}

public void register(final IoTDBSchemaRegionExtractor extractor) {
// The metric is global thus the regionId is omitted
final String pipeID = extractor.getPipeName() + "_" + extractor.getCreationTime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void commit(final EnrichedEvent event, final CommitterKey committerKey) {
eventCommitterRestartTimesMap.computeIfAbsent(
generateCommitterRestartTimesKey(committerKey), k -> 0);
if (committerKey.getRestartTimes() < currentRestartTimes) {
LOGGER.warn(
LOGGER.debug(
"stale PipeEventCommitter({}) when commit event: {}, current restart times {}",
committerKey,
event.coreReportMessage(),
Expand Down