Skip to content

Commit

Permalink
Merge branch 'release-1.16.9' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
edmc-ss committed Aug 7, 2020
2 parents dc8c81a + f547818 commit 90f3eae
Show file tree
Hide file tree
Showing 19 changed files with 235 additions and 209 deletions.
9 changes: 9 additions & 0 deletions ci/ansible/tasks/files/usr/bin/resetswift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e

/usr/bin/unmount_and_stop_pfs
echo "Resetting Swift drives..."
rm -rf /srv/?/node/d?/*
echo "Resetting Swift logs..."
sudo find /var/log/swift -type f -exec truncate {} --size 0 \;
/usr/bin/start_and_mount_pfs "$@"
8 changes: 8 additions & 0 deletions ci/ansible/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,14 @@
group: root
mode: '0755'

- name: Reset Swift script
copy:
src: usr/bin/resetswift
dest: /usr/bin/resetswift
owner: root
group: root
mode: '0755'

- name: Install 3 versions of Golang (current, candidate, and latest)
block:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set -e
/usr/bin/unmount_and_stop_pfs
cd $GOPATH/src/github.com/swiftstack/ProxyFS
ci/ansible/install_proxyfs.sh {{ env_arg }} {{ ss_packages_arg }} {{ active_golang_version }}
/usr/bin/start_and_mount_pfs
/usr/bin/start_and_mount_pfs "$@"
4 changes: 2 additions & 2 deletions conf/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,10 @@ func (confMap ConfMap) Dump() (confMapString string) {
confSectionNameSliceIndex int
)

// 1 Mibyte should be more than enough to hold the confMap so get the
// 2 Mibyte should be more than enough to hold the confMap so get the
// memory in 1 allocation
var buf strings.Builder
buf.Grow(1024 * 1024)
buf.Grow(2 * 1024 * 1024)

confSectionNameSlice = make([]string, 0, len(confMap))

Expand Down
5 changes: 3 additions & 2 deletions inode/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ func adoptVolumeGroupReadCacheParameters(confMap conf.ConfMap) (err error) {

readCacheLineCount = readCacheTotalSize / volumeGroup.readCacheLineSize
if 0 == readCacheLineCount {
err = fmt.Errorf("[VolumeGroup:%s]ReadCacheWeight must result in at least one ReadCacheLineSize (%v) of memory", volumeGroup.name, volumeGroup.readCacheLineSize)
return
logger.Infof("Computed 0 ReadCacheLines for Volume Group %v; increasing to 1",
volumeGroup.name)
readCacheLineCount = 1
}

volumeGroup.Lock()
Expand Down
10 changes: 5 additions & 5 deletions liveness/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ type globalsStruct struct {
swiftConfDir string
swiftReconChecksPerConfCheck uint64
swiftReconChecksUntilConfCheck uint64
swiftConfFileMap map[string]time.Time // Key == os.FileInfo.Name(); Value == os.FileInfo.ModTime()
swiftReconEndpointSet map[string]struct{} // Key == IPAddrPort of ReconEndpoint
swiftConfFileMap map[string]time.Time // Key == os.FileInfo.Name(); Value == os.FileInfo.ModTime()
swiftReconEndpointSet map[string]struct{} // Key == IPAddrPort of ReconEndpoint
crc64ECMATable *crc64.Table
nextNonce uint64 // Randomly initialized... skips 0
recvMsgsDoneChan chan struct{}
Expand All @@ -175,11 +175,11 @@ type globalsStruct struct {
stateMachineStopChan chan struct{}
stateMachineDone sync.WaitGroup
livenessCheckerControlChan chan bool // Send true to trigger livenessChecker() to recompute polling schedule
// Send false to trigger livenessChecker() to exit
// Send false to trigger livenessChecker() to exit
livenessCheckerWG sync.WaitGroup
volumeToCheckList []*volumeStruct
emptyVolumeGroupToCheckSet map[string]string // List (in "set" form) of VolumeGroups (by name) with no Volumes (Value == ServingPeer)
emptyServingPeerToCheckSet map[string]struct{} // List (in "set" form) of ServingPeers (by name) with no VolumeGroups
emptyVolumeGroupToCheckSet map[string]string // List (in "set" form) of VolumeGroups (by name) with no Volumes (Value == ServingPeer)
emptyServingPeerToCheckSet map[string]struct{} // List (in "set" form) of ServingPeers (by name) with no VolumeGroups
myObservingPeerReport *internalObservingPeerReportStruct
livenessReport *internalLivenessReportStruct
curRWMode inode.RWModeType
Expand Down
17 changes: 9 additions & 8 deletions liveness/polling.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ func livenessChecker() {
entityToCheck *list.Element
err error
livenessCheckerControlChanValue bool
myObservingPeerReport *internalObservingPeerReportStruct
reconEndpoint *internalReconEndpointReportStruct
servingPeer *internalServingPeerReportStruct
volume *internalVolumeReportStruct
Expand All @@ -67,11 +66,10 @@ func livenessChecker() {

for {
globals.Lock()
myObservingPeerReport = globals.myObservingPeerReport
globals.Unlock()

if nil == myObservingPeerReport {
if nil == globals.myObservingPeerReport {
// Just wait to be signaled to check again... or exit
globals.Unlock()
livenessCheckerControlChanValue = <-globals.livenessCheckerControlChan
if livenessCheckerControlChanValue {
// Just loop back and re-check globals.myObservingPeerReport
Expand All @@ -80,15 +78,16 @@ func livenessChecker() {
globals.livenessCheckerWG.Done()
return
}
} else { // nil != myObservingPeerReport
} else { // nil != globals.myObservingPeerReport
// Check to see if we are supposed to exit

select {
case livenessCheckerControlChanValue = <-globals.livenessCheckerControlChan:
if livenessCheckerControlChanValue {
// Just loop back and re-check globals.myObservingPeerReport
// Just fall into checkEntityList processing
} else {
// Exit
globals.Unlock()
globals.livenessCheckerWG.Done()
return
}
Expand All @@ -100,7 +99,7 @@ func livenessChecker() {

checkEntityList = list.New()

for _, servingPeer = range myObservingPeerReport.servingPeer {
for _, servingPeer = range globals.myObservingPeerReport.servingPeer {
_ = checkEntityList.PushBack(servingPeer)

for _, volumeGroup = range servingPeer.volumeGroup {
Expand All @@ -112,10 +111,12 @@ func livenessChecker() {
}
}

for _, reconEndpoint = range myObservingPeerReport.reconEndpoint {
for _, reconEndpoint = range globals.myObservingPeerReport.reconEndpoint {
_ = checkEntityList.PushBack(reconEndpoint)
}

globals.Unlock()

utils.RandomizeList(checkEntityList)

// Compute number of entities to check & time between each check
Expand Down
7 changes: 4 additions & 3 deletions logger/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func openLogFile(confMap conf.ConfMap) (err error) {
if logFilePath != "" {
logFile, err = os.OpenFile(logFilePath, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
if err != nil {
log.Errorf("couldn't open log file: %v", err)
log.Errorf("couldn't open log file '%s': %v", logFilePath, err)
return err
}
}
Expand Down Expand Up @@ -131,7 +131,7 @@ func openLogFile(confMap conf.ConfMap) (err error) {
debugConfSlice, _ := confMap.FetchOptionValueStringSlice("Logging", "DebugLevelLogging")
setDebugLoggingLevel(debugConfSlice)

Infof("logger opened logfile (PID %d)", os.Getpid())
Infof("logger opened logfile '%s' (PID %d)", logFilePath, os.Getpid())
return
}

Expand Down Expand Up @@ -184,10 +184,11 @@ func SignaledStart(confMap conf.ConfMap) (err error) {

func SignaledFinish(confMap conf.ConfMap) (err error) {

Infof("logger is closing and reopening logfile (PID %d)", os.Getpid())
Infof("logger is closing logfile (PID %d)", os.Getpid())
err = closeLogFile(confMap)
if nil == err {
err = openLogFile(confMap)
Infof("logger opened logfile (PID %d)", os.Getpid())
}
return
}
Expand Down
2 changes: 1 addition & 1 deletion pfs_middleware/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ usedevelop = True
deps =
lint: flake8
!lint: -r{toxinidir}/test-requirements.txt
release: git+git://github.com/swiftstack/[email protected].4
release: git+git://github.com/swiftstack/[email protected].5
minver: http://tarballs.openstack.org/swift/swift-2.9.0.tar.gz
master: http://tarballs.openstack.org/swift/swift-master.tar.gz
commands = python -m unittest discover
Expand Down
4 changes: 2 additions & 2 deletions pfsagentd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ HTTPServerIPAddr: 0.0.0.0
HTTPServerTCPPort: 9090
ReadDirPlusEnabled: false
XAttrEnabled: false
EntryDuration: 10s
AttrDuration: 10s
EntryDuration: 0s
AttrDuration: 0s
AttrBlockSize: 65536
ReaddirMaxEntries: 1024
FUSEMaxBackground: 100
Expand Down
Loading

0 comments on commit 90f3eae

Please sign in to comment.