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

ignore zk node already exist when store provider/consumer metadata #2311

Merged
merged 5 commits into from
Jun 3, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions metadata/report/zookeeper/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,23 @@ func (m *zookeeperMetadataReport) PublishAppMetadata(metadataIdentifier *identif
// StoreProviderMetadata stores the metadata.
func (m *zookeeperMetadataReport) StoreProviderMetadata(providerIdentifier *identifier.MetadataIdentifier, serviceDefinitions string) error {
k := m.rootDir + providerIdentifier.GetFilePathKey()
return m.client.CreateWithValue(k, []byte(serviceDefinitions))
err := m.client.CreateWithValue(k, []byte(serviceDefinitions))
if err == zk.ErrNodeExists {
logger.Debugf("Try to store provider metadata failed. In most cases, it's not a problem. ")
return nil
}
return err
}

// StoreConsumerMetadata stores the metadata.
func (m *zookeeperMetadataReport) StoreConsumerMetadata(consumerMetadataIdentifier *identifier.MetadataIdentifier, serviceParameterString string) error {
k := m.rootDir + consumerMetadataIdentifier.GetFilePathKey()
return m.client.CreateWithValue(k, []byte(serviceParameterString))
err := m.client.CreateWithValue(k, []byte(serviceParameterString))
if err == zk.ErrNodeExists {
Leospard marked this conversation as resolved.
Show resolved Hide resolved
logger.Debugf("Try to store consumer metadata failed. In most cases, it's not a problem. ")
return nil
}
return err
}

// SaveServiceMetadata saves the metadata.
Expand Down