Skip to content

Commit

Permalink
fix(pkg): Rename replication-related fields in GRPC protocol
Browse files Browse the repository at this point in the history
Field identifiers remained the same thus the compatibility
between different server versions is preserved.

Signed-off-by: Bartłomiej Święcki <[email protected]>
  • Loading branch information
Bartłomiej Święcki committed Nov 9, 2022
1 parent bda1945 commit f8a6c4a
Show file tree
Hide file tree
Showing 16 changed files with 1,206 additions and 1,206 deletions.
10 changes: 5 additions & 5 deletions cmd/immuadmin/command/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,27 +399,27 @@ func prepareDatabaseNullableSettings(flags *pflag.FlagSet) (*schema.DatabaseNull
return nil, err
}

ret.ReplicationSettings.MasterDatabase, err = condString("replication-primary-database")
ret.ReplicationSettings.PrimaryDatabase, err = condString("replication-primary-database")
if err != nil {
return nil, err
}

ret.ReplicationSettings.MasterAddress, err = condString("replication-primary-host")
ret.ReplicationSettings.PrimaryHost, err = condString("replication-primary-host")
if err != nil {
return nil, err
}

ret.ReplicationSettings.MasterPort, err = condUInt32("replication-primary-port")
ret.ReplicationSettings.PrimaryPort, err = condUInt32("replication-primary-port")
if err != nil {
return nil, err
}

ret.ReplicationSettings.FollowerUsername, err = condString("replication-primary-username")
ret.ReplicationSettings.PrimaryUsername, err = condString("replication-primary-username")
if err != nil {
return nil, err
}

ret.ReplicationSettings.FollowerPassword, err = condString("replication-primary-password")
ret.ReplicationSettings.PrimaryPassword, err = condString("replication-primary-password")
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/immuadmin/command/hot_backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ func (cl *commandlineHotBck) useDb(name string, replica bool) (uint64, []byte, e
}

func (cl *commandlineHotBck) createDb(name string) error {
err := cl.immuClient.CreateDatabase(cl.context, &schema.DatabaseSettings{DatabaseName: name, Replica: true, MasterDatabase: "dummy"})
err := cl.immuClient.CreateDatabase(cl.context, &schema.DatabaseSettings{DatabaseName: name, Replica: true, PrimaryDatabase: "dummy"})
if err != nil {
return err
}
Expand Down
64 changes: 32 additions & 32 deletions pkg/api/schema/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
- [ExportTxRequest](#immudb.schema.ExportTxRequest)
- [FlushIndexRequest](#immudb.schema.FlushIndexRequest)
- [FlushIndexResponse](#immudb.schema.FlushIndexResponse)
- [FollowerState](#immudb.schema.FollowerState)
- [HealthResponse](#immudb.schema.HealthResponse)
- [HistoryRequest](#immudb.schema.HistoryRequest)
- [ImmutableState](#immudb.schema.ImmutableState)
Expand Down Expand Up @@ -79,6 +78,7 @@
- [Precondition.KeyNotModifiedAfterTXPrecondition](#immudb.schema.Precondition.KeyNotModifiedAfterTXPrecondition)
- [Reference](#immudb.schema.Reference)
- [ReferenceRequest](#immudb.schema.ReferenceRequest)
- [ReplicaState](#immudb.schema.ReplicaState)
- [ReplicationNullableSettings](#immudb.schema.ReplicationNullableSettings)
- [RetryInfo](#immudb.schema.RetryInfo)
- [Row](#immudb.schema.Row)
Expand Down Expand Up @@ -461,11 +461,11 @@ DEPRECATED
| ----- | ---- | ----- | ----------- |
| databaseName | [string](#string) | | Name of the database |
| replica | [bool](#bool) | | If set to true, this database is replicating another database |
| masterDatabase | [string](#string) | | Name of the database to replicate |
| masterAddress | [string](#string) | | Hostname of the immudb instance with database to replicate |
| masterPort | [uint32](#uint32) | | Port of the immudb instance with database to replicate |
| followerUsername | [string](#string) | | Username of the user with read access of the database to replicate |
| followerPassword | [string](#string) | | Password of the user with read access of the database to replicate |
| primaryDatabase | [string](#string) | | Name of the database to replicate |
| primaryHost | [string](#string) | | Hostname of the immudb instance with database to replicate |
| primaryPort | [uint32](#uint32) | | Port of the immudb instance with database to replicate |
| primaryUsername | [string](#string) | | Username of the user with read access of the database to replicate |
| primaryPassword | [string](#string) | | Password of the user with read access of the database to replicate |
| fileSize | [uint32](#uint32) | | Size of files stored on disk |
| maxKeyLen | [uint32](#uint32) | | Maximum length of keys |
| maxValueLen | [uint32](#uint32) | | Maximum length of values |
Expand Down Expand Up @@ -744,7 +744,7 @@ DualProof contains inclusion and consistency proofs for dual Merkle-Tree &#43; L
| ----- | ---- | ----- | ----------- |
| tx | [uint64](#uint64) | | Id of transaction to export |
| allowPreCommitted | [bool](#bool) | | If set to true, non-committed transactions can be exported |
| followerState | [FollowerState](#immudb.schema.FollowerState) | | Used on synchronous replication to notify the master about follower state |
| replicaState | [ReplicaState](#immudb.schema.ReplicaState) | | Used on synchronous replication to notify the primary about replica state |



Expand Down Expand Up @@ -782,25 +782,6 @@ DualProof contains inclusion and consistency proofs for dual Merkle-Tree &#43; L



<a name="immudb.schema.FollowerState"></a>

### FollowerState



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| UUID | [string](#string) | | |
| committedTxID | [uint64](#uint64) | | |
| committedAlh | [bytes](#bytes) | | |
| precommittedTxID | [uint64](#uint64) | | |
| precommittedAlh | [bytes](#bytes) | | |






<a name="immudb.schema.HealthResponse"></a>

### HealthResponse
Expand Down Expand Up @@ -1399,6 +1380,25 @@ Only succeed if given key was not modified after given transaction



<a name="immudb.schema.ReplicaState"></a>

### ReplicaState



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| UUID | [string](#string) | | |
| committedTxID | [uint64](#uint64) | | |
| committedAlh | [bytes](#bytes) | | |
| precommittedTxID | [uint64](#uint64) | | |
| precommittedAlh | [bytes](#bytes) | | |






<a name="immudb.schema.ReplicationNullableSettings"></a>

### ReplicationNullableSettings
Expand All @@ -1408,16 +1408,16 @@ Only succeed if given key was not modified after given transaction
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| replica | [NullableBool](#immudb.schema.NullableBool) | | If set to true, this database is replicating another database |
| masterDatabase | [NullableString](#immudb.schema.NullableString) | | Name of the database to replicate |
| masterAddress | [NullableString](#immudb.schema.NullableString) | | Hostname of the immudb instance with database to replicate |
| masterPort | [NullableUint32](#immudb.schema.NullableUint32) | | Port of the immudb instance with database to replicate |
| followerUsername | [NullableString](#immudb.schema.NullableString) | | Username of the user with read access of the database to replicate |
| followerPassword | [NullableString](#immudb.schema.NullableString) | | Password of the user with read access of the database to replicate |
| primaryDatabase | [NullableString](#immudb.schema.NullableString) | | Name of the database to replicate |
| primaryHost | [NullableString](#immudb.schema.NullableString) | | Hostname of the immudb instance with database to replicate |
| primaryPort | [NullableUint32](#immudb.schema.NullableUint32) | | Port of the immudb instance with database to replicate |
| primaryUsername | [NullableString](#immudb.schema.NullableString) | | Username of the user with read access of the database to replicate |
| primaryPassword | [NullableString](#immudb.schema.NullableString) | | Password of the user with read access of the database to replicate |
| syncReplication | [NullableBool](#immudb.schema.NullableBool) | | Enable synchronous replication |
| syncAcks | [NullableUint32](#immudb.schema.NullableUint32) | | Number of confirmations from synchronous replicas required to commit a transaction |
| prefetchTxBufferSize | [NullableUint32](#immudb.schema.NullableUint32) | | Maximum number of prefetched transactions |
| replicationCommitConcurrency | [NullableUint32](#immudb.schema.NullableUint32) | | Number of concurrent replications |
| AllowTxDiscarding | [NullableBool](#immudb.schema.NullableBool) | | Allow precommitted transactions to be discarded if the follower diverges from the master |
| AllowTxDiscarding | [NullableBool](#immudb.schema.NullableBool) | | Allow precommitted transactions to be discarded if the replica diverges from the primary |



Expand Down
Loading

0 comments on commit f8a6c4a

Please sign in to comment.