@@ -197,16 +197,27 @@ private async Task ConfigurePostgreSQLServerAsync(EventContext telemetryContext,
197197 . FirstOrDefault ( ) ? . IPAddress
198198 ?? IPAddress . Loopback . ToString ( ) ;
199199
200- string innoDbDirs = ! string . IsNullOrEmpty ( this . StripeDiskMountPoint ) ? this . StripeDiskMountPoint : await this . GetPostgreSQLInnodbDirectoriesAsync ( cancellationToken ) ;
201-
202200 string arguments = $ "{ this . packageDirectory } /configure-server.py --dbName { this . DatabaseName } --serverIp { serverIp } --password { this . SuperUserPassword } --port { this . Port } --inMemory { this . SharedMemoryBuffer } ";
203201
204- if ( innoDbDirs != null )
202+ string innoDbDirs = string . Empty ;
203+ if ( this . Parameters . ContainsKey ( nameof ( this . DiskFilter ) ) || ! string . IsNullOrEmpty ( this . StripeDiskMountPoint ) )
205204 {
206- if ( innoDbDirs . Split ( ';' , StringSplitOptions . RemoveEmptyEntries ) . Length == 1 )
205+ innoDbDirs = this . Parameters . ContainsKey ( nameof ( this . DiskFilter ) ) ? await this . GetPostgreSQLInnodbDirectoriesAsync ( cancellationToken ) : string . Empty ;
206+ innoDbDirs = ! string . IsNullOrEmpty ( this . StripeDiskMountPoint ) ? this . StripeDiskMountPoint : innoDbDirs ;
207+
208+ if ( ! string . IsNullOrEmpty ( innoDbDirs ) )
207209 {
208- string cleanDirectory = innoDbDirs . TrimEnd ( ';' ) ;
209- arguments += $ " --innodbDirectory { cleanDirectory } ";
210+ if ( innoDbDirs . Split ( ';' , StringSplitOptions . RemoveEmptyEntries ) . Length == 1 )
211+ {
212+ string cleanDirectory = innoDbDirs . TrimEnd ( ';' ) ;
213+ arguments += $ " --innodbDirectory { cleanDirectory } ";
214+ }
215+ else
216+ {
217+ throw new WorkloadException (
218+ "Multiple InnoDB directories detected. Please specify a single directory for PostgreSQL configuration when using the DiskFilter parameter explicitly for PostgreSQLServerConfiguration." ,
219+ ErrorReason . InvalidProfileDefinition ) ;
220+ }
210221 }
211222 }
212223
0 commit comments