Skip to content

Commit

Permalink
Fix random access alignment
Browse files Browse the repository at this point in the history
Summary:
This fixes an issue when the most recent readers assume that alignment is always set even if direct io is off.
Also adjust slightly appveyor script to run db_basic_test cases concurrently.
Closes facebook#1959

Differential Revision: D4671972

Pulled By: IslamAbdelRahman

fbshipit-source-id: 1886620
  • Loading branch information
yuslepukhin authored and facebook-github-bot committed Mar 9, 2017
1 parent f649915 commit c9df05d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
11 changes: 7 additions & 4 deletions build_tools/run_ci_db_test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ Write-Output "Root: $RootFolder, WorkFolder: $WorkFolder"

# Use JEMALLOC executables
if($Run -ceq "db_test" -or
$Run -ceq "db_test2" ) {
$Run -ceq "db_test2" -or
$Run -ceq "db_basic_test") {

$file_name = $Run

Expand Down Expand Up @@ -150,7 +151,7 @@ function MakeAndAdd([string]$token, $HashTable) {
# Test executable name -> Log file
function Discover-TestBinaries([string]$Pattern, $HashTable) {

$Exclusions = @("db_test*", "db_sanity_test*")
$Exclusions = @("db_test*", "db_sanity_test*", "db_basic_test*")

$p = -join ($BinariesFolder, $pattern)

Expand All @@ -164,7 +165,8 @@ function Discover-TestBinaries([string]$Pattern, $HashTable) {
$TestsToRun = [ordered]@{}

if($Run -ceq "db_test" -or
$Run -ceq "db_test2") {
$Run -ceq "db_test2" -or
$Run -ceq "db_basic_test") {
Normalize-DbTests -HashTable $TestsToRun
} elseif($Run -ceq "tests") {
if($EnableJE) {
Expand Down Expand Up @@ -237,7 +239,8 @@ function RunJobs($TestToLog, [int]$ConcurrencyVal, [bool]$AddForRerun)
$log_path = ($TestToLog.$k)

if($Run -ceq "db_test" -or
$Run -ceq "db_test2") {
$Run -ceq "db_test2" -or
$Run -ceq "db_basic_test") {
$job = Start-Job -Name $k -ScriptBlock $InvokeTestCase -ArgumentList @($db_test,$k,$log_path)
} else {
[string]$Exe = -Join ($BinariesFolder, $k)
Expand Down
9 changes: 3 additions & 6 deletions port/win/io_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -723,12 +723,9 @@ WinRandomAccessImpl::WinRandomAccessImpl(WinFileData* file_base,

assert(!options.use_mmap_reads);

// Direct access, use internal buffer for reads
if (file_base_->use_direct_io()) {
// Do not allocate the buffer either until the first request or
// until there is a call to allocate a read-ahead buffer
buffer_.Alignment(alignment);
}
// Do not allocate the buffer either until the first request or
// until there is a call to allocate a read-ahead buffer
buffer_.Alignment(alignment);
}

inline
Expand Down

0 comments on commit c9df05d

Please sign in to comment.