Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into createpitrest
  • Loading branch information
bharath-techie committed Aug 26, 2022
2 parents 4ec23ca + 1bfabed commit 66b0ca7
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/changelog_verifier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.ref }}
ref: ${{ github.event.pull_request.head.sha }}

- uses: dangoslen/dependabot-changelog-helper@v1

Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,26 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Removed

### Fixed
- `opensearch-service.bat start` and `opensearch-service.bat manager` failing to run ([#4289](https://github.com/opensearch-project/OpenSearch/pull/4289))
- PR reference to checkout code for changelog verifier ([#4296](https://github.com/opensearch-project/OpenSearch/pull/4296))

### Security

## [2.x]
### Added
- Github workflow for changelog verification ([#4085](https://github.com/opensearch-project/OpenSearch/pull/4085))

### Changed

### Deprecated

### Removed

### Fixed
- PR reference to checkout code for changelog verifier ([#4296](https://github.com/opensearch-project/OpenSearch/pull/4296))

### Security


[Unreleased]: https://github.com/opensearch-project/OpenSearch/compare/2.2.0...HEAD
[2.x]: https://github.com/opensearch-project/OpenSearch/compare/2.2.0...2.x
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ As a contributor, you must ensure that every pull request has the changes listed
Adding in the change is two step process -
1. Add your changes to the corresponding section within the CHANGELOG file with dummy pull request information, publish the PR

`Your change here ([#PR_NUMBER](PR_URL))`

2. Update the entry for your change in [`CHANGELOG.md`](CHANGELOG.md) and make sure that you reference the pull request there.


Expand Down
15 changes: 13 additions & 2 deletions distribution/src/bin/opensearch-service.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ if /i "%1" == "install" set NOJAVA=

call "%~dp0opensearch-env.bat" %NOJAVA% || exit /b 1

rem opensearch-service-x64.exe is based off of the Apache Commons Daemon procrun service application.
rem Run "opensearch-service-x64.exe version" for version information.
rem Run "opensearch-service-x64.exe help" for command options.
rem See https://commons.apache.org/proper/commons-daemon/procrun.html for more information.
set EXECUTABLE=%OPENSEARCH_HOME%\bin\opensearch-service-x64.exe
if "%SERVICE_ID%" == "" set SERVICE_ID=opensearch-service-x64
set ARCH=64-bit
Expand Down Expand Up @@ -45,7 +49,8 @@ echo Usage: opensearch-service.bat install^|remove^|start^|stop^|manager [SERVIC
goto:eof

:doStart
"%EXECUTABLE%" //OPENSEARCH//%SERVICE_ID% %LOG_OPTS%
rem //ES == Execute Service
"%EXECUTABLE%" //ES//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto started
echo Failed starting '%SERVICE_ID%' service
exit /B 1
Expand All @@ -55,6 +60,7 @@ echo The service '%SERVICE_ID%' has been started
goto:eof

:doStop
rem //SS == Stop Service
"%EXECUTABLE%" //SS//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto stopped
echo Failed stopping '%SERVICE_ID%' service
Expand All @@ -65,8 +71,11 @@ echo The service '%SERVICE_ID%' has been stopped
goto:eof

:doManagment
rem opensearch-service-mgr.exe is based off of the Apache Commons Daemon procrun monitor application.
rem See https://commons.apache.org/proper/commons-daemon/procrun.html for more information.
set EXECUTABLE_MGR=%OPENSEARCH_HOME%\bin\opensearch-service-mgr
"%EXECUTABLE_MGR%" //OPENSEARCH//%SERVICE_ID%
rem //ES == Edit Service
"%EXECUTABLE_MGR%" //ES//%SERVICE_ID%
if not errorlevel 1 goto managed
echo Failed starting service manager for '%SERVICE_ID%'
exit /B 1
Expand All @@ -77,6 +86,7 @@ goto:eof

:doRemove
rem Remove the service
rem //DS == Delete Service
"%EXECUTABLE%" //DS//%SERVICE_ID% %LOG_OPTS%
if not errorlevel 1 goto removed
echo Failed removing '%SERVICE_ID%' service
Expand Down Expand Up @@ -207,6 +217,7 @@ if not "%SERVICE_USERNAME%" == "" (
set SERVICE_PARAMS=%SERVICE_PARAMS% --ServiceUser "%SERVICE_USERNAME%" --ServicePassword "%SERVICE_PASSWORD%"
)
)
rem //IS == Install Service
"%EXECUTABLE%" //IS//%SERVICE_ID% --Startup %OPENSEARCH_START_TYPE% --StopTimeout %OPENSEARCH_STOP_TIMEOUT% --StartClass org.opensearch.bootstrap.OpenSearch --StartMethod main ++StartParams --quiet --StopClass org.opensearch.bootstrap.OpenSearch --StopMethod close --Classpath "%OPENSEARCH_CLASSPATH%" --JvmMs %JVM_MS% --JvmMx %JVM_MX% --JvmSs %JVM_SS% --JvmOptions %OTHER_JAVA_OPTS% ++JvmOptions %OPENSEARCH_PARAMS% %LOG_OPTS% --PidFile "%SERVICE_ID%.pid" --DisplayName "%SERVICE_DISPLAY_NAME%" --Description "%SERVICE_DESCRIPTION%" --Jvm "%JAVA_HOME%%JVM_DLL%" --StartMode jvm --StopMode jvm --StartPath "%OPENSEARCH_HOME%" %SERVICE_PARAMS% ++Environment HOSTNAME="%%COMPUTERNAME%%"

if not errorlevel 1 goto installed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,51 +177,6 @@ public boolean reset(CancellableThreads newTargetCancellableThreads) throws IOEx
return false;
}

/**
* cancel the recovery. calling this method will clean temporary files and release the store
* unless this object is in use (in which case it will be cleaned once all ongoing users call
* {@link #decRef()}
* <p>
* if {@link #cancellableThreads()} was used, the threads will be interrupted.
*/
public void cancel(String reason) {
if (finished.compareAndSet(false, true)) {
try {
logger.debug("recovery canceled (reason: [{}])", reason);
cancellableThreads.cancel(reason);
} finally {
// release the initial reference. recovery files will be cleaned as soon as ref count goes to zero, potentially now
decRef();
}
}
}

/**
* fail the recovery and call listener
*
* @param e exception that encapsulating the failure
* @param sendShardFailure indicates whether to notify the cluster-manager of the shard failure
*/
public void fail(RecoveryFailedException e, boolean sendShardFailure) {
super.fail(e, sendShardFailure);
}

/** mark the current recovery as done */
public void markAsDone() {
if (finished.compareAndSet(false, true)) {
assert multiFileWriter.tempFileNames.isEmpty() : "not all temporary files are renamed";
try {
// this might still throw an exception ie. if the shard is CLOSED due to some other event.
// it's safer to decrement the reference in a try finally here.
indexShard.postRecovery("peer recovery done");
} finally {
// release the initial reference. recovery files will be cleaned as soon as ref count goes to zero, potentially now
decRef();
}
listener.onDone(state());
}
}

@Override
protected void closeInternal() {
try {
Expand All @@ -246,8 +201,6 @@ protected String getPrefix() {
@Override
protected void onDone() {
assert multiFileWriter.tempFileNames.isEmpty() : "not all temporary files are renamed";
// this might still throw an exception ie. if the shard is CLOSED due to some other event.
// it's safer to decrement the reference in a try finally here.
indexShard.postRecovery("peer recovery done");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public void markAsDone() {
public void cancel(String reason) {
if (finished.compareAndSet(false, true)) {
try {
logger.debug("replication cancelled (reason: [{}])", reason);
logger.debug("replication/recovery cancelled (reason: [{}])", reason);
onCancel(reason);
} finally {
// release the initial reference. replication files will be cleaned as soon as ref count goes to zero, potentially now
Expand Down

0 comments on commit 66b0ca7

Please sign in to comment.