Skip to content

Conversation

@davidcheng0922
Copy link
Contributor

Which issue(s) this PR fixes:

longhorn/longhorn#10294

What this PR does / why we need it:

For v1 replica deleting, not only delete the instance and also remove the replica from the controller.

ReplicaRemove will stop the related snapshot hash

Special notes for your reviewer:

Additional documentation or context

@coderabbitai
Copy link

coderabbitai bot commented Nov 6, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@davidcheng0922 davidcheng0922 force-pushed the issue-10294-disable-snapshot-hashing branch from 693bf92 to b4c5ca9 Compare November 6, 2025 09:52
@mantissahz mantissahz requested review from a team, PhanLe1010 and derekbit November 7, 2025 06:43
@derekbit derekbit force-pushed the issue-10294-disable-snapshot-hashing branch 2 times, most recently from 449c1b2 to b816dd5 Compare November 13, 2025 07:31
@davidcheng0922 davidcheng0922 force-pushed the issue-10294-disable-snapshot-hashing branch from b816dd5 to 94f0076 Compare November 19, 2025 05:24
@derekbit derekbit force-pushed the issue-10294-disable-snapshot-hashing branch 2 times, most recently from 1a1c016 to 80c86f7 Compare November 25, 2025 16:13
@derekbit
Copy link
Member

@coderabbitai review

@derekbit derekbit force-pushed the issue-10294-disable-snapshot-hashing branch from 80c86f7 to 2cfc6e4 Compare November 25, 2025 16:26
@coderabbitai
Copy link

coderabbitai bot commented Nov 25, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@derekbit derekbit force-pushed the issue-10294-disable-snapshot-hashing branch from 2cfc6e4 to 5bf4595 Compare November 28, 2025 01:22
…move()

Signed-off-by: David Cheng <davidcheng0922@gmail.com>
@derekbit derekbit force-pushed the issue-10294-disable-snapshot-hashing branch from 5bf4595 to a1c874a Compare December 7, 2025 15:57
Comment on lines +658 to +661
engineClientProxy, err := rc.getEngineClientProxy(engine, engine.Status.CurrentImage)
if err != nil {
return err
}
Copy link
Member

Choose a reason for hiding this comment

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

Should close the connection

Suggested change
engineClientProxy, err := rc.getEngineClientProxy(engine, engine.Status.CurrentImage)
if err != nil {
return err
}
engineClientProxy, err := rc.getEngineClientProxy(engine, engine.Status.CurrentImage)
if err != nil {
return errors.Wrapf(err, "failed to get the engine client proxy for ...)
}
defer engineClientProxy.Close()

Comment on lines +617 to +624
if types.IsDataEngineV1(r.Spec.DataEngine) {
// remove replica from controller in v1
// for v2, ReplicaRemove() equals to InstanceDelete()
// ReplicaRemove() will also cancel the related snapshot hash
if err := rc.ReplicaRemove(r); err != nil {
rc.logger.WithError(err).Warn("Failed to remove the replica")
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Won't the ReplicaRemove conflict with the following c.InstanceDelete?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Double check it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it will not conflict

In v1
ReplicaRemove: remove replica from replicator backend, stop replica monitoring
InstanceDelete: process manager unregister replica process and release port

But I will re-test it after spdk upgrade issue sovled

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.

2 participants