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

add linerizability #2287

Merged
merged 1 commit into from
Apr 4, 2018
Merged

add linerizability #2287

merged 1 commit into from
Apr 4, 2018

Conversation

janardhan1993
Copy link
Contributor

@janardhan1993 janardhan1993 commented Mar 30, 2018

Fixes #2148 #2143

This change is Reviewable

@manishrjain
Copy link
Contributor

Review status: 0 of 5 files reviewed at latest revision, all discussions resolved.


x/noncecounter.go, line 1 at r1 (raw file):

package x

We don't need a noncecounter class. Just use the standard lib random number generation, that we use for proposal contexts.


Comments from Reviewable

@CLAassistant
Copy link

CLAassistant commented Apr 3, 2018

CLA assistant check
All committers have signed the CLA.

@janardhan1993
Copy link
Contributor Author

Review status: 0 of 6 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


x/noncecounter.go, line 1 at r1 (raw file):

Previously, manishrjain (Manish R Jain) wrote…

We don't need a noncecounter class. Just use the standard lib random number generation, that we use for proposal contexts.

Done.


Comments from Reviewable

@manishrjain
Copy link
Contributor

Reviewed 3 of 5 files at r1, 4 of 4 files at r2.
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed.


posting/list.go, line 357 at r2 (raw file):

		// follower scheduler doesn't care about those commitOrAbort proposals.
		if commitTs := Oracle().CommitTs(l.markdeleteAll); commitTs > 0 {
			l.commitMutation(ctx, l.markdeleteAll, commitTs)

What is happening here? The comment has grammatical errors, so it's hard to understand as well.


worker/draft.go, line 546 at r2 (raw file):

			return
		case <-readStateCh:
			// Do nothing, discard ReadState info we don't have an activeRctx for

Comment is half broken.


worker/draft.go, line 558 at r2 (raw file):

			}
			activeRctx := make([]byte, 8)
			binary.LittleEndian.PutUint64(activeRctx[0:8], rand.Uint64())

You can use rand.Read directly. Also, instead of using global rand, ensure that we create a rand local to this package or struct.


worker/draft.go, line 568 at r2 (raw file):

			ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
			// We ignore the err - it would be n.ctx cancellation (which we must ignore because
			// it's our duty to continue until `stop` is triggered) or raft.ErrStopped (which we

I never got this reasoning. We should handle error.


Comments from Reviewable

@manishrjain
Copy link
Contributor

:lgtm:


Reviewed 2 of 2 files at r3.
Review status: all files reviewed at latest revision, 4 unresolved discussions, some commit checks failed.


worker/draft.go, line 560 at r3 (raw file):

			}
			activeRctx := make([]byte, 8)
			n.rand.Read(activeRctx[:])

This returns error. Assert it.


Comments from Reviewable

replace noncecounter with rand

update

update

update
@janardhan1993 janardhan1993 merged commit 1f42c56 into master Apr 4, 2018
@janardhan1993 janardhan1993 deleted the jan/linerizability branch April 4, 2018 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants