Skip to content

Commit ae0e6e4

Browse files
committed
Post-migration deployment
1 parent 953eb03 commit ae0e6e4

File tree

6 files changed

+13
-330
lines changed

6 files changed

+13
-330
lines changed

share-api.cabal

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ library
3131
Share.BackgroundJobs.Diffs.ContributionDiffs
3232
Share.BackgroundJobs.Diffs.Queries
3333
Share.BackgroundJobs.EntityDepthMigration.Queries
34-
Share.BackgroundJobs.EntityDepthMigration.Worker
3534
Share.BackgroundJobs.Errors
3635
Share.BackgroundJobs.Monad
3736
Share.BackgroundJobs.Search.DefinitionSync

src/Share/BackgroundJobs.hs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
module Share.BackgroundJobs (startWorkers) where
22

33
import Ki.Unlifted qualified as Ki
4-
import Share.BackgroundJobs.EntityDepthMigration.Worker qualified as EntityDepthMigration
54
import Share.BackgroundJobs.Monad (Background)
65
import Share.BackgroundJobs.Search.DefinitionSync qualified as DefnSearch
76

87
-- | Kicks off all background workers.
98
startWorkers :: Ki.Scope -> Background ()
109
startWorkers scope = do
1110
DefnSearch.worker scope
12-
-- Temporary disable background diff jobs until the new diffing logic is done.
13-
-- ContributionDiffs.worker scope
14-
-- SerializedEntitiesMigration.worker scope
15-
EntityDepthMigration.worker scope
11+
12+
-- Temporary disable background diff jobs until the new diffing logic is done.
13+
-- ContributionDiffs.worker scope
14+
-- SerializedEntitiesMigration.worker scope

src/Share/BackgroundJobs/EntityDepthMigration/Queries.hs

Lines changed: 0 additions & 241 deletions
This file was deleted.

src/Share/BackgroundJobs/EntityDepthMigration/Worker.hs

Lines changed: 0 additions & 70 deletions
This file was deleted.

src/Share/Web/UCM/SyncV2/Impl.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ batchSize :: Int32
4848
batchSize = 1000
4949

5050
streamSettings :: Hash32 -> Maybe SyncV2.BranchRef -> StreamInitInfo
51-
streamSettings rootCausalHash rootBranchRef = StreamInitInfo {version = SyncV2.Version 1, entitySorting = SyncV2.Unsorted, numEntities = Nothing, rootCausalHash, rootBranchRef}
51+
streamSettings rootCausalHash rootBranchRef = StreamInitInfo {version = SyncV2.Version 1, entitySorting = SyncV2.DependenciesFirst, numEntities = Nothing, rootCausalHash, rootBranchRef}
5252

5353
server :: Maybe UserId -> SyncV2.Routes WebAppServer
5454
server mayUserId =

src/Share/Web/UCM/SyncV2/Queries.hs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -201,21 +201,17 @@ allSerializedDependenciesOfCausalCursor cid exceptCausalHashes = do
201201
JOIN bytes ON sc.bytes_id = bytes.id
202202
LEFT JOIN causal_depth cd ON tc.causal_id = cd.causal_id
203203
)
204-
-- Re-add this once the migration is done.
205204
-- Put them in dependency order, nulls come first because we want to bail and
206-
-- report an error
207-
-- if we somehow are missing a depth.
208-
-- ORDER BY depth ASC NULLS FIRST
205+
-- report an error if we are somehow missing a depth.
206+
ORDER BY depth ASC NULLS FIRST
209207
|]
210-
-- pure
211-
-- ( cursor <&> \(bytes, hash, depth) -> case depth of
212-
-- -- This should never happen, but is a sanity check in case we're missing a depth.
213-
-- -- Better than silently omitting a required result.
214-
-- Nothing -> error $ "allSerializedDependenciesOfCausalCursor: Missing depth for entity: " <> show hash
215-
-- Just _ -> (bytes, hash)
216-
-- )
217208
pure
218-
(cursor <&> \(bytes, hash, _depth) -> (bytes, hash))
209+
( cursor <&> \(bytes, hash, depth) -> case depth of
210+
-- This should never happen, but is a sanity check in case we're missing a depth.
211+
-- Better than silently omitting a required result.
212+
Nothing -> error $ "allSerializedDependenciesOfCausalCursor: Missing depth for entity: " <> show hash
213+
Just _ -> (bytes, hash)
214+
)
219215

220216
spineAndLibDependenciesOfCausalCursor :: CausalId -> CodebaseM e (PGCursor (Hash32, IsCausalSpine, IsLibRoot))
221217
spineAndLibDependenciesOfCausalCursor cid = do

0 commit comments

Comments
 (0)