Skip to content

Introduce ForceRerun parameter for Linux RCv2#65

Closed
viveklingaiah wants to merge 1 commit into
mainfrom
dev/vivekl/forceRerunParameter
Closed

Introduce ForceRerun parameter for Linux RCv2#65
viveklingaiah wants to merge 1 commit into
mainfrom
dev/vivekl/forceRerunParameter

Conversation

@viveklingaiah

Copy link
Copy Markdown
Contributor
  • If ForceRerun = true, Linux RCv2 will be force run even if new sequence number has already been noted down to be run previously.

Comment thread internal/cmds/cmds.go
func checkAndSaveSeqNum(ctx log.Logger, seq int, mrseqPath string, forceRerun bool) (shouldExit bool, _ error) {
ctx.Log("event", "comparing seqnum", "path", mrseqPath)
smaller, err := seqnum.IsSmallerThan(mrseqPath, seq)
isSavedSeqNumSmallerThanNewSeqNum, err := seqnum.IsSmallerThan(mrseqPath, seq)

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 should trace somewhere (and also put it in an extension event) that the force flag was used.

Comment thread internal/cmds/cmds.go
}

if !smaller {
if !forceRerun && !isSavedSeqNumSmallerThanNewSeqNum {

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.

What happens if the machine is rebooted? From this it appears we'll run the script every time RCV2 is executed. Why not just have CRP increment the seqNo?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I did think about it earlier. Do you mean instead of making this "ForceRun" (thinking to rename it) flag change in Windows and Linux extensions, we could just increment sequence number in CRP ? Only thing is it may not work right away if for some reason the VM has much higher sequence number than what CRP has. Especially, Linux uses files to note down mrseq number and if user reuses a disk for example. That may be an edge case though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think just incrementing it in CRP is a better solution. I'll close this PR

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