-
Notifications
You must be signed in to change notification settings - Fork 65
Marshal the value into the null value if the slot is not migrating #346
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
Conversation
…luster migrating_slot value is string type
|
@hll1213181368 Can you share which version(or commit id) you're using? I cannot find which version was using the string type for the migration slot. |
in the slot.go file. The function of MigrateSlot's String() returns string type to caller. The cases are following: So I think, we should return string to caller. |
Compatible with old version migrating_slot is -1 to return null
|
@git-hulk Please review my pull. I modify the cluster is not migrating to return nil. Compatibly with old version return -1. |
|
int -1 is used before @bseto chaning migrate single slot to SlotRange, |
|
@greatsharp @hll1213181368 I'm sorry that I cannot get what's going wrong in your case. What your change is from |
@git-hulk 我直接中文交流吧。 现在新版本支持slot范围迁移,migrating_slot返回的是字符串,例如:正在迁移1024-2048区间段,返回的是“1024-2048”;如果不处于迁移中,返回的是null。 现在为了兼容之前旧集群保存在etcd中的migrating_slot为-1信息。针对新旧集群,如果不处于迁移中,都返回nil。旧集群在新版本控制器做切换更新拓扑后,会把之前-1的更改为nil。 |
modify the TestMigratingSlot_MarshalJSON expected value
migrating return null []byte when cluster is not migrating
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## unstable #346 +/- ##
============================================
+ Coverage 43.38% 47.30% +3.91%
============================================
Files 37 45 +8
Lines 2971 4446 +1475
============================================
+ Hits 1289 2103 +814
- Misses 1544 2135 +591
- Partials 138 208 +70
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@git-hulk Please review my PR. After we will commit new PR to fix tryUpdateMigrationStatus function code: sourceNodeClusterInfo.MigratingSlot maybe return nil |
we read from an old cluster that had
-1denoting !isMigrating, but new cluster migrating_slot value is string type. so we should return "-1" is not -1.