Skip to content

HDDS-6895. EC: ReplicationManager - Logic to process the under replicated queue and assign work to DNs - #3599

Merged
umamaheswararao merged 11 commits into
apache:masterfrom
sodonnel:ec-HDDS-6895
Jul 18, 2022
Merged

HDDS-6895. EC: ReplicationManager - Logic to process the under replicated queue and assign work to DNs#3599
umamaheswararao merged 11 commits into
apache:masterfrom
sodonnel:ec-HDDS-6895

Conversation

@sodonnel

@sodonnel sodonnel commented Jul 14, 2022

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

We need some sort of thread which picks work from the under / over replicated queue and assigns the work to DNs with capacity. The DNs will pick the work up on each heartbeat.

This initial change does not consider DN capacity or any limits. It will process all under replicated EC containers and assign them to the DN.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-6895

How was this patch tested?

New unit tests added

type = ConfigType.TIME,
defaultValue = "30s",
tags = {SCM, OZONE},
description = "Hpw frequently to check if there are work to process " +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hqw --> How

@umamaheswararao umamaheswararao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall patch looks good to me.
There is a typo comment to address, otherwise let's push this.

I feel we need some integration tests around this. But we can add in followup JIRA. Let me file one.


private final long containerID;
private final List<DatanodeDetails> sourceDatanodes;
private int replicaIndex = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed offline about alternative approach to get the replicaIndex. I am updating here for the discussion context.
We discussed that this may be ok and simpler, even though we are not using this at the DN side currently. We could potentially use this for validation purposes if needed.

The alternative method is that we could add a methods at ContainerManager to get the replicaIndex and we can use that method to get replicaIndex for a given node. After discussion we felt this is ok to just add to command rather than going back to container manager.

@adoroszlai adoroszlai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, only noticed some more typos.

ecReplicationConfig, HddsIdFactory.getLongId());
}

// Should be called only for protobuf conversion

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: comment seems to be outdated, as now it's called from the other constructor.

* into maintenance.
* @return Returns the key value pair of destination dn where the command gets
* executed and the command itself.
* executed and the command itself. If an empty list if returned, it indicates

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* executed and the command itself. If an empty list if returned, it indicates
* executed and the command itself. If an empty list is returned, it indicates

private final ReentrantLock lock = new ReentrantLock();
private Queue<ContainerHealthResult.UnderReplicatedHealthResult>
underRepQueue;
private ECUnderReplicationHandler ecUnderReplicationHandler;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be final?

Suggested change
private ECUnderReplicationHandler ecUnderReplicationHandler;
private final ECUnderReplicationHandler ecUnderReplicationHandler;

* into maintenance.
* @return Returns the key value pair of destination dn where the command gets
* executed and the command itself.
* executed and the command itself. If an empty list if returned, it indicates

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* executed and the command itself. If an empty list if returned, it indicates
* executed and the command itself. If an empty list is returned, it indicates

@umamaheswararao umamaheswararao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@umamaheswararao
umamaheswararao merged commit 9ebb4aa into apache:master Jul 18, 2022
duongkame pushed a commit to duongkame/ozone that referenced this pull request Aug 16, 2022
…replicated queues and assign work to DNs

HDDS-6895. EC: ReplicationManager - Logic to process the under replicated queue and assign work to DNs (apache#3599)

(cherry picked from commit 9ebb4aa)
Change-Id: I88836a439f5526c6e33e4e54df9797004bc2418a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants