SDP-542 #2

  • //
  • spec/
  • job/
  • SDP-542
  • View
  • Commits
  • Open Download .zip Download (6 KB)
# The form data below was edited by tom_tyler
# Perforce Workshop Jobs
#
#  Job:           The job name. 'new' generates a sequenced job number.
#
#  Status:        Job status; required field.  There is no enforced or
#                 promoted workflow for transition of jobs from one
#                 status to another, just a set of job status values
#                 for users to apply as they see fit.  Possible values:
#
#                 open - Issue is available to be worked on.
#
#                 inprogress - Active development is in progress.
#
#                 blocked - Issue cannot be implemented for some reason.
#
#                 fixed - Fixed, optional status to use before closed.
#                 
#                 closed - Issue has been dealt with definitively.
#
#                 punted - Decision made not to address the issue,
#                    possibly not ever.
#
#                 suspended - Decision made not to address the issue
#                    in the immediate future, but noting that it may
#                    have some merit and may be revisited later.
#
#                 duplicate - Duplicate of another issue that.
#
#                 obsolete - The need behind the request has become
#                    overcome by events.
#
#  Project:       The project this job is for. Required.
#
#  Severity:      [A/B/C] (A is highest)  Required.
#
#  ReportedBy     The user who created the job. Can be changed.
#
#  ReportedDate:  The date the job was created.  Automatic.
#
#  ModifiedBy:    The user who last modified this job. Automatic.
#
#  ModifiedDate:  The date this job was last modified. Automatic.
#
#  OwnedBy:       The owner, responsible for doing the job. Optional.
#
#  Description:   Description of the job.  Required.
#
#  DevNotes:      Developer's comments.  Optional.  Can be used to
#                 explain a status, e.g. for blocked, punted,
#                 obsolete or duplicate jobs.  May also provide
#                 additional information such as the earliest release
#                 in which a bug is known to exist.
#
# Component:      Projects may use this optional field to indicate
#                 which component of the project a givenjob is associated
#                 with.
#
#                 For the SDP, the list of components is defined in:
#                 //guest/perforce_software/sdp/tools/components.txt
#
#  Type:          Type of job [Bug/Feature].  Required.
#
#  Release:       Release in which job is intended to be fixed.

Job:	SDP-542

Status:	closed

Project:	perforce-software-sdp

Severity:	C

ReportedBy:	tom_tyler

ReportedDate:	2020/06/12 06:42:41

ModifiedBy:	tom_tyler

ModifiedDate:	2021/01/29 16:31:52

OwnedBy:	tom_tyler

Description:
	In load_checkpoint.sh, move journal aside after db upgrade for standbys.
	
	The load_checkpoint.sh is used in the scenario where you are loading
	a fresh checkpoint, e.g. for reseed of a replica, server migration of
	a master, etc. It moves any pre-existing P4JOURNAL (and P4LOG) aside
	before calling the '-xu' database upgrade step. This makes sense for
	the scenario of loading a fresh checkpoint, since any journal and log
	data wouldn't be associated with the fresh checkpoint.
	
	When the database upgrade ('-xu') is done, new journal data may be
	written. Exactly what if anything is written depends on the p4d
	version. Depending on the specific scenario that load_checkpoint.sh
	is being used for, we may or may not care about any newly written
	journal data.  Specifically:
	
	* If load_checkpoint.sh is being used to reseed a journalcopy/standby
	replica, we must move the P4JOURNAL file aside. That is because a
	journalcopy replica expects the P4JOURNAL not to exist when p4d starts
	up, and it isn't happy if it exists with contents. Upon startup of
	a journalcopy replica, p4d initializes a zero-length journal file that
	remains zero length (with actual journal data being written to a
	file named journal.NNN, where NNN is the journal counter). If a
	journal file exists with contents, replication will not start as it
	should when the p4d process starts up.
	* If we are reseeding any other type of replica, including an edge
	server, we should also move the P4JOURNAL file aside.  While these
	other replica types aren't sensitive to the existence of a P4JOURNAL
	with contents on startup, there's no value in preserving that data
	in a reseed scenario.
	* When load_checkpoint.sh is used to start a new master server,
	any data generated during the database upgrade must be preserved.
	This is especially important when load_checkpoint.sh is to load a
	checkpoint from an older p4d as part of a migration to a newer p4d
	on new hardware, a common use case for load_checkpoint.sh.
	
	The current implementation of load_checkpoint.sh only removes
	journal data that existed before the checkpoint replay and journal
	reseed.  This works for the scenario of loading a checkpoint from
	a master on a new server. However, for the reseed of a
	journalcopy replica, manual intervetnion is needed (simply moving
	aside the P4JOURNAL file, and optionally P4LOG as well), better
	behavior would be to detect if the checkpiont replayed was for a
	a standby replica after the checkpoint replay operation, and decide
	then if the current P4JOURNAL file should be moved aside. The
	check would be based on the server.id file and the data the
	checkpoint that is available after the checkpoint replay.
	
	To better support journalcopy/standby replics, load_checkpoint.sh
	should do a second journal removal after the database upgrade step,
	but only if reseeding a replica. It makes sense to move the
	P4JOURNAL aside for any kind of reseed, journalcopy or otherwise,
	though it is only required for a journalcopy reseed.
	
	== Summary of what p4d writes to P4JOURNAL during upgrades == 
	
	During 'p4d -xu' different versions of p4d write different things:
	
	* Pre-2019.1 p4d won't generate anything significant in the
	journal.
	* Pre-2018.2 won't generate anything at all.
	* 2018.2 writes only notes about Extensions that were tech preview
	rather than released functionality in 2018.2.
	* 2019.1+ p4d may write important journal data during the offline
	  portion of the db upgrade process (the '-xu' part).

Component:	core-unix

Type:	Bug
# Change User Description Committed
#2 default
#1 default