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

fix sequence in meta proto #4497

Merged
merged 2 commits into from
Oct 19, 2015
Merged

fix sequence in meta proto #4497

merged 2 commits into from
Oct 19, 2015

Conversation

corylanou
Copy link
Contributor

We skipped a sequence for some reason. Assuming this was not intentional.

The messages have the right sequence later in the file. This fix aligns the sequences back up.

@nathanielc can you verify this?

@dgnorton
Copy link
Contributor

@corylanou Will this break existing DBs?

@corylanou
Copy link
Contributor Author

I'm not sure, it may, but I think that might be better than allowing the bug to live forever. It should only be part of the nightly for now and not a previous release. @pauldix thoughts?

@otoolep
Copy link
Contributor

otoolep commented Oct 19, 2015

Does it matter? Just use 21 next time we have a message, right?

@corylanou
Copy link
Contributor Author

@otoolep if you look further down, the messages use 121, and 122, not 122, and 123.. so this is likely going to be a bug some day for us I suspect.

@otoolep
Copy link
Contributor

otoolep commented Oct 19, 2015

I took a look at the code.

We store these commands in the Raft log AFAIK. Therefore this change is not backwards compatible and will force people to blow away their systems on upgrade. Normally this change would be a non-starter, but because no-one should have run these commands, we should be OK.

@otoolep
Copy link
Contributor

otoolep commented Oct 19, 2015

At least, that is my reading from a quick glance at the code. Since this is code that should never have been run yet, +1 from me.

@corylanou
Copy link
Contributor Author

For context the reason I caught this is I was doing a rebase on my branch where I used 21 and 121, so if we don't fix it, I'll end up with 21 and then 123 for the corresponding message. Effectively we'll have 3 enums that don't line up with the corresponding message sequences.

We would have these enums:

RemovePeerCommand                = 21;
CreateSubscriptionCommand        = 22;
DropSubscriptionCommand          = 23;

And these messages:

message CreateSubscriptionCommand {
    extend Command {
        optional CreateSubscriptionCommand command = 121;
    }
    required string Name = 1;
    required string Database = 2;
    required string RetentionPolicy = 3;
    required string Mode = 4;
    repeated string Destinations = 5;

}

message DropSubscriptionCommand {
    extend Command {
        optional DropSubscriptionCommand command = 122;
    }
    required string Name = 1;
    required string Database = 2;
    required string RetentionPolicy = 3;
}
message RemovePeerCommand {
    extend Command {
        optional RemovePeerCommand command = 123;
    }
        required uint64 ID = 1;
        required string Addr = 2;
}

@nathanielc
Copy link
Contributor

@corylanou The fix looks good to me. Where did 'drop server' go? That was the one that got added while I re-based and so I bumped up the sequence. Just want to make sure that it wasn't accidentally removed.

@corylanou
Copy link
Contributor Author

@nathanielc It got reverted in a future pull. That makes sense why that got skipped then. The real issue is that the message numbers didn't line up with the enums. If it had, this would be a non-issue as we could of just used that on the next PR. Regardless, this should get everything synced up. Thanks!

corylanou added a commit that referenced this pull request Oct 19, 2015
@corylanou corylanou merged commit defd017 into master Oct 19, 2015
@corylanou corylanou deleted the fix-meta-proto branch October 19, 2015 15:06
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.

None yet

4 participants