提交 2d0396e9 编写于 作者: S slguan

Merge remote-tracking branch 'origin/feature/sync' into feature/balance

...@@ -56,15 +56,12 @@ typedef struct { ...@@ -56,15 +56,12 @@ typedef struct {
} SNodesRole; } SNodesRole;
typedef struct { typedef struct {
char label[20]; // for debug purpose
char path[128]; // path to the file
int8_t replica; // number of replications, >=1
int8_t quorum; // number of confirms required, >=1
int32_t vgId; // vgroup ID int32_t vgId; // vgroup ID
void *ahandle; // handle provided by APP
uint64_t version; // initial version uint64_t version; // initial version
uint32_t arbitratorIp; SSyncCfg syncCfg; // configuration from mgmt
SNodeInfo nodeInfo[TAOS_SYNC_MAX_REPLICA]; char path[128]; // path to the file
void *ahandle; // handle provided by APP
// if name is null, get the file from index or after, used by master // if name is null, get the file from index or after, used by master
// if name is provided, get the named file at the specified index, used by unsynced node // if name is provided, get the named file at the specified index, used by unsynced node
...@@ -76,7 +73,7 @@ typedef struct { ...@@ -76,7 +73,7 @@ typedef struct {
int (*getWalInfo)(char *name, int *index); int (*getWalInfo)(char *name, int *index);
// when a forward pkt is received, call this to handle data // when a forward pkt is received, call this to handle data
int (*writeToCache)(void *ahandle, SWalHead *, int type); int (*writeToCache)(void *ahandle, void *pHead, int type);
// when forward is confirmed by peer, master call this API to notify app // when forward is confirmed by peer, master call this API to notify app
void (*confirmForward)(void *ahandle, void *mhandle, int32_t code); void (*confirmForward)(void *ahandle, void *mhandle, int32_t code);
...@@ -89,8 +86,8 @@ typedef void* tsync_h; ...@@ -89,8 +86,8 @@ typedef void* tsync_h;
tsync_h syncStart(SSyncInfo *); tsync_h syncStart(SSyncInfo *);
void syncStop(tsync_h shandle); void syncStop(tsync_h shandle);
int syncReconfig(tsync_h shandle, SSyncInfo *); int syncReconfig(tsync_h shandle, SSyncCfg *);
int syncForwardToPeer(tsync_h shandle, SWalHead *pHead, void *mhandle); int syncForwardToPeer(tsync_h shandle, void *pHead, void *mhandle);
void syncConfirmForward(tsync_h shandle, uint64_t version, int32_t code); void syncConfirmForward(tsync_h shandle, uint64_t version, int32_t code);
void syncRecover(tsync_h shandle); // recover from other nodes: void syncRecover(tsync_h shandle); // recover from other nodes:
int syncGetNodesRole(tsync_h shandle, SNodesRole *); int syncGetNodesRole(tsync_h shandle, SNodesRole *);
......
...@@ -43,9 +43,9 @@ print $data10 $data11 $data22 ...@@ -43,9 +43,9 @@ print $data10 $data11 $data22
print $data20 $data11 $data22 print $data20 $data11 $data22
print =============== insert data print =============== insert data
sql insert into d1.n1 values(now, 1) sql insert into d1.n1 values(now+1s, 1)
sql insert into d1.n1 values(now, 2) sql insert into d1.n1 values(now+2s, 2)
sql insert into d1.n1 values(now, 3) sql insert into d1.n1 values(now+3s, 3)
print =============== query data print =============== query data
sql select * from d1.n1 sql select * from d1.n1
......
...@@ -43,9 +43,9 @@ print $data10 $data11 $data22 ...@@ -43,9 +43,9 @@ print $data10 $data11 $data22
print $data20 $data11 $data22 print $data20 $data11 $data22
print =============== insert data print =============== insert data
sql insert into db.n1 values(now, 1) sql insert into db.n1 values(now+1s, 1)
sql insert into db.n1 values(now, 2) sql insert into db.n1 values(now+2s, 2)
sql insert into db.n1 values(now, 3) sql insert into db.n1 values(now+3s, 3)
print =============== query data print =============== query data
sql select * from db.n1 sql select * from db.n1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册