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

spi-command: CommandJdo implement CommandWithDto in order to support replay (ISIS-1569) #69

Closed
danhaywood opened this Issue Jan 18, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@danhaywood
Contributor

danhaywood commented Jan 18, 2018

danhaywood added a commit that referenced this issue Jan 25, 2018

danhaywood added a commit that referenced this issue Jan 25, 2018

#69 - implementation of replay command module, and enhancements/exten…
…sions to command dom module in support.

command-impl:
- BackgroundCommandServiceRepository#findBackgroundCommandsNotYetStarted -> renamed to #findBackgroundOrReplayableCommandsNotYetStarted
- CommandServiceJdoRepository - renames #findSince to #findToReplicateSince; renames #findFirst to #findToReplicateFirst; adds findReplayHwm; renames #save to #saveForReplay and use timings DTO;
- CommandJdo - additional JDOQL queries, new indices, uses timings DTO rather than generic userData
- renames CommandReplayMenu to CommandReplayOnMasterService; renames #findCommandsSince to #findCommandsOnMasterSince; renames #downloadCommandSince to #downloadCommandsOnMasterSince; removes uploadCommands which are moved to...
- new CommandReplayOnSlaveService - #uploadCommandsToSlave; #findReplayHwmOnSlave;

command-replay:
- new ReplicateCommandsToReplayJob - quartz job implementation

jaxrs-client:
- JaxRsClient = adds new #get method and allows reprType to be specified (object or action-result);

danhaywood added a commit that referenced this issue Jan 25, 2018

@danhaywood danhaywood added this to In Progress in incode-platform (project) Jan 25, 2018

danhaywood added a commit that referenced this issue Jan 26, 2018

#69 - refines BackgroundCommandServiceJdoRepository so that only retu…
…rns replayable commands if there are no failed replayables already. Also...

... also, refines the retry mixin for CommamdJdo, so can reuse the same command or reschedule a new.  For replayable, these can only be reused if retried.
... also, adds a new 'exclude' mixin to allow failing replayable commands to be ignored/skipped.

danhaywood added a commit that referenced this issue Jan 26, 2018

#69 - for publishing of the retry of commands, guards against title s…
…et too long on the persisted PublishedEvent.

danhaywood added a commit that referenced this issue Jan 26, 2018

danhaywood added a commit that referenced this issue Jan 26, 2018

#69 - adds "findBlockedOnSlave" action, with fix JDOQL in CommandJdo …
…for corresponding query (findAnyFailedReplayableCommands)

danhaywood added a commit that referenced this issue Jan 29, 2018

#69 - improvrments to menu actions for CommandReplayOn{Master/Slave}S…
…ervice

on master:
- use the ContentMappingServiceForCommandsDto to do the mapping, therefore to add in any missing blobs
- new downloadCommandById

on slave:
- findMostRecentReplayableOnSlave
- uploadCommandsToSlave accepts either a CommandDto or a CommandsDto XML

also:
- moved some methods from BackgroundCommandServiceJdoRepository to CommandServiceJdoRepository

danhaywood added a commit that referenced this issue Jan 29, 2018

#69 - factors out new RunReplicatedCommandsJob
also updates incode quickstart app to use

danhaywood added a commit that referenced this issue Jan 29, 2018

#69 - consolidates actions on CommandReplayOnSlaveService to findRepl…
…ayQueueOnSlave

also:
- renames/generalizes some JDOQL query names:
  - findToReplicateFirst -> findForegroundFirst
  - findToReplicateSince -> findForegroundSince
  -
- renames RunReplicatedCommandsJob to RunReplayableCommandsJob

danhaywood added a commit that referenced this issue Jan 29, 2018

#69 - makes CommandJdo#exception visible, removes showException actio…
…n; also...

also:
- adds 'nextFailed' mixin for CommandJdo
-  tidies up the other mixins.

danhaywood added a commit that referenced this issue Jan 31, 2018

#69 - uses ticking clock to run commands seemingly at the time that t…
…hey occurred on master. Also...

also:
- CommandJdos when saved for replay use the timestamp from the DTO, rather than the startedAt.
- adds new TickingClockService (similar to SudoService, but for time rather than user)
- removes logic to populate userData in CommandJdo#asDto, this is now done in Isis' ContentMappingServiceForCommandDto.

danhaywood added a commit that referenced this issue Feb 1, 2018

#69 - Replay job is a no-op until the TickingClockService is initiali…
…zed.

To avoid a possible race condition between quartz kicking in and the TickingClockService not yet having had init called upon it.

danhaywood added a commit that referenced this issue Feb 1, 2018

danhaywood added a commit that referenced this issue Feb 2, 2018

#69 - combines the jobs to replicate and replay commands, to instead …
…process commands one-by-one

specifically:
- deletes RunReplayableCommandsJob, ReplicateCommandsJob
- replaces with ReplayableCommandExecution
  - main algorithm here
  - fetch hwm, obtain next if no HWM available or was processed successfully, exec next, exec its background children, capture if replay was success ... and loop
- new ReplayState for CommandJdo to keep track of whether replay was success
- reworks mixin (exclude, retry) on CommandJdo to use this new replayState
- removes nextFailed mixin for CommandJdo, since no longer makes sense
- new implementation of CommandsDtoProcessService to count number background commands and add to the replicated DTO
  -  one of the checks for whether failed

danhaywood added a commit that referenced this issue Feb 3, 2018

#69 - refactors ReplayableCommandExecution to use CommandExecutorService
specifically:
- new CommandExecutorServiceWithTime
- moves CommandReplayOn{Master/Slave}Service from command module to replay module
- moves openOnMaster mixin from command module to replay module
- factors out CommandFetcher service
- factors out CommandReplayAnalyser service
- makes TickingClockService more rboust

danhaywood added a commit that referenced this issue Feb 3, 2018

danhaywood added a commit that referenced this issue Feb 5, 2018

#69 - allows CommandFetcher to fetch >1, to allow for fact that some …
…commands may not be replicated

Also:
- placement of mixins
- fix to wall time of TickingClockService

danhaywood added a commit that referenced this issue Feb 6, 2018

danhaywood added a commit that referenced this issue Feb 7, 2018

#69 - fixes HWM derivation after db restore. also
also, adds the ability to control whether replay is paused or running with a new optional SPI

danhaywood added a commit that referenced this issue Feb 7, 2018

#69 - uses CommandPersistence.NOT_PERSISTED for mixins
instead of CommandRefication.DISABLED, that seems to be incorrectly implemented.

danhaywood added a commit that referenced this issue Feb 8, 2018

#69 - adds replayQueue mixin for commands, standardises layout (using…
… .layout.fallback.xml) for audit, command, publishedevent, statusmessage and sessionlogentry.

Also
* removes findReplayedOnSlave for CommandReplayOnSlaveService
* makes titles for these entities more consistent with each other
* ensures that command#resultStr does not exceed its length if too long.

danhaywood added a commit that referenced this issue Feb 8, 2018

danhaywood added a commit that referenced this issue Feb 12, 2018

#69 - makes analysis more resilient, reinstates upload command for sl…
…ave service, adds download mixin for Command.

danhaywood added a commit that referenced this issue Feb 12, 2018

danhaywood added a commit that referenced this issue Feb 13, 2018

danhaywood added a commit that referenced this issue Feb 13, 2018

@danhaywood danhaywood moved this from In Progress to Resolved / Closed in incode-platform (project) Feb 22, 2018

@danhaywood danhaywood closed this Mar 8, 2018

@danhaywood danhaywood removed this from Resolved / Closed in incode-platform (project) Mar 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment