Skip to content

about different schema for our service and ovn #448

@gujun4990

Description

@gujun4990

Description

Our service uses libovsdb to access the OVN Northbound (NB) and Southbound (SB) databases. The data models were generated by modelgen based on the OVN 21.09 schema. After upgrading OVN from 21.09 to 24.09, the service fails to update the requested_chassis column in the Port_Binding table of the SB database.

E1013 11:15:28.883641   10125 cache.go:935] "during libovsdb cache populate2" err="column: requested_chassis not found in table: Port_Binding" logger="libovsdb.cache" db="sbdb" database="OVN_Southbound"
E1013 11:15:28.883712   10125 client.go:1178] "error updating cache, DB schema may be newer than client!" err="column: requested_chassis not found in table: Port_Binding" logger="libovsdb" db="sbdb" database="OVN_Southbound"

Analysis

The issue occurs because the requested_chassis column does not exist in the 21.09 schema but was introduced in 24.09. Consequently, when libovsdb attempts to parse updates involving the requested_chassis column, it cannot find the corresponding field in the generated model, leading to an error.

// updateOrModifyModel updates info about a model with a given row containing
// the change. The change row itself can be interpreted as an update or a
// modify. If the change is an update and a modify row is provided, it will be
// filled with the modify data.
func updateOrModifyModel(dbModel model.DatabaseModel, table string, info *mapper.Info, changeRow, modifyRow *ovsdb.Row, isModify bool) (bool, error) {
	schema := dbModel.Schema.Table(table)
	var changed bool

	for column, updateOvs := range *changeRow {
		colSchema := schema.Column(column)
		if colSchema == nil {
			// ignore columns we don't know about in our schema
			continue
		}

		currentNative, err := info.FieldByColumn(column) // This will return the failure
		if err != nil {
			return false, err
		}
...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions