Skip to content

Commit bd5923f

Browse files
Simplify history detection and version selection
1 parent 4835105 commit bd5923f

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

‎bundle/phases/dms.go‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,7 @@ func startVersion(ctx context.Context, b *bundle.Bundle, versionType dms.Version
193193
// InitializeOperationBuffer moves the anchor below, so callers afterwards read the created
194194
// version straight off the state.
195195
previous := db.StateDB.VersionID
196-
versionID := previous + 1
197-
if !db.StateDB.IsDeploymentMetadataService() {
198-
versionID = max(previous, db.StateDB.Data.Serial) + 1
199-
}
196+
versionID := max(previous, db.StateDB.Data.Serial) + 1
200197
previousVersionID := ""
201198
if previous > 0 {
202199
previousVersionID = strconv.Itoa(previous)

‎bundle/statemgmt/state_pull.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (s *StateDesc) IsDMS() bool {
8080
// RecordsHistory includes both DMS-authoritative state and file-backed history.
8181
func (s *StateDesc) RecordsHistory() bool {
8282
_, bestEffort := s.Features["deployment_history_best_effort"]
83-
return s.IsDMS() || bestEffort
83+
return bestEffort || s.IsDMS()
8484
}
8585

8686
func localRead(ctx context.Context, fullPath string, engine engine.EngineType) *StateDesc {

0 commit comments

Comments
 (0)