Skip to content

Commit

Permalink
Merge pull request #1521 from memphisdev/bugfix-RND-346-side-station-…
Browse files Browse the repository at this point in the history
…dls-no-attached-side-dls-station-while-user-using-in-station-name-with-special-characters

fix
  • Loading branch information
shohamroditimemphis authored Dec 13, 2023
2 parents 80c554f + 381d068 commit 147c7a3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/memphis_handlers_stations.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,9 @@ func (s *Server) createStationDirectIntern(c *client,
return
}

dlsStationNameToLower := strings.ToLower(csr.DlsStation)
if csr.DlsStation != "" {
DlsStation, err := StationNameFromStr(csr.DlsStation)
DlsStation, err := StationNameFromStr(dlsStationNameToLower)
if err != nil {
serv.Warnf("[tenant: %v][user:%v]createStationDirect at StationNameFromStr: Station %v: %v", csr.TenantName, csr.Username, csr.DlsStation, err.Error())
jsApiResp.Error = NewJSStreamCreateError(err)
Expand All @@ -452,7 +453,7 @@ func (s *Server) createStationDirectIntern(c *client,
}
if !exist {
var created bool
dlsStationName, err := StationNameFromStr(csr.DlsStation)
dlsStationName, err := StationNameFromStr(dlsStationNameToLower)
if err != nil {
serv.Errorf("[tenant: %v][user:%v]createStationDirect at DLS StationNameFromStr: %v", csr.TenantName, csr.Username, err.Error())
respondWithErr(s.MemphisGlobalAccountString(), s, reply, err)
Expand Down Expand Up @@ -520,7 +521,7 @@ func (s *Server) createStationDirectIntern(c *client,
}
}

newStation, rowsUpdated, err := db.InsertNewStation(stationName.Ext(), user.ID, user.Username, retentionType, retentionValue, storageType, replicas, schemaDetails.SchemaName, schemaDetails.VersionNumber, csr.IdempotencyWindow, isNative, csr.DlsConfiguration, csr.TieredStorageEnabled, user.TenantName, partitionsList, 2, csr.DlsStation)
newStation, rowsUpdated, err := db.InsertNewStation(stationName.Ext(), user.ID, user.Username, retentionType, retentionValue, storageType, replicas, schemaDetails.SchemaName, schemaDetails.VersionNumber, csr.IdempotencyWindow, isNative, csr.DlsConfiguration, csr.TieredStorageEnabled, user.TenantName, partitionsList, 2, dlsStationNameToLower)
if err != nil {
if !strings.Contains(err.Error(), "already exist") {
serv.Errorf("[tenant: %v][user:%v]createStationDirect at InsertNewStation: Station %v: %v", csr.TenantName, csr.Username, csr.StationName, err.Error())
Expand Down

0 comments on commit 147c7a3

Please sign in to comment.