xbase ahora inestable, lenta, error Status_Lock_Not_Granted

xbase ahora inestable, lenta, error Status_Lock_Not_Granted

Postby José » Fri Jan 18, 2019 6:00 pm

Estimado foro

Buenas tardes, primero gracias a todos por los aportes que hacen y que tanto ayudan a usuarios menos expertos. Ahora, por sugerencia de Antonio Linares, directo a platear mi situación, aclarando que he leído todo lo que he encontrado, tanto en estos foros como en Microsoft y otros:

Tengo un software con Fivewin + xHarbour, que usa base de datos xBase. Hasta hace un tiempo andaba todo bien, pero creo que en la medida que las estaciones de trabajo se han actualizado a Windows 7, 8 y 10 y el servidor Linux a Debian 8 o superior, con SMB2 (SMB 1 ya no aplica), cada vez tengo más problemas, está más lento, se producen errores de “Status_Lock_Not_Granted” que generalmente hacen que todo se pegue y haya que bajar y subir Samba, se dañan los índices, es inestable.

Y parece ser aleatorio, aunque suele estar relacionado con las ocasiones en que hay más carga de trabajo o más usuarios trabajando. También hemos notado que el servidor tiene los System Interrupt más altos de lo normal casi de forma permanente.

Hemos probado muchas cosas que nos han recomendado, certificar la red, asegurarnos que no estemos intentando bloquear registros que ya están bloqueados (eso provoca muchos problemas ahora que antes no tenía), usar más el commit buscando que la información esté más estable; incluir estos parámetros (en CERO) en las estaciones de trabajo:

FileInfoCacheLifetime
FileNotFoundCacheLifetime
DirectoryCacheLifetime

Y estos en el Servidor:

Blocking Locks (NO)
Strict Bloking (NO)
OpLoc Nivel 2 (omisión, SI)

(todo después de muchas pruebas, algunas con resultados desastrosos)

Ya no sabemos que más hacer intentando que la ddbb xBase opere bien.

¿Qué sugerencias pueden darme? Si han tenido esta experiencia ¿cómo lo resolvieron manteniendo la ddbb xBase (DBF/CDX)?

Muchas gracias por leer y por responder, necesito luz.
José Concha Leiva - Chile
"Querer, saber y hacer, es poder"
HB MSVSC + FWH 23.10 + MySQL/MaríaDB/DBFCDX (64 bits)
https://zenitx.com
User avatar
José
 
Posts: 38
Joined: Sat Dec 10, 2016 8:58 pm

Re: xbase ahora inestable, lenta, error Status_Lock_Not_Granted

Postby Antonio Linares » Fri Jan 18, 2019 6:08 pm

José,

Desactiva SMB2 como se explica aquí:

viewtopic.php?f=3&t=21740&start=0
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: xbase ahora inestable, lenta, error Status_Lock_Not_Granted

Postby José » Fri Jan 18, 2019 8:10 pm

Antonio

Gracias por tu respuesta. Estudiando la información para aplicar.

Si alguien tiene más sugerencias o experiencias que puedan aportarnos, se lo agradecemos.

José
José Concha Leiva - Chile
"Querer, saber y hacer, es poder"
HB MSVSC + FWH 23.10 + MySQL/MaríaDB/DBFCDX (64 bits)
https://zenitx.com
User avatar
José
 
Posts: 38
Joined: Sat Dec 10, 2016 8:58 pm

Re: xbase ahora inestable, lenta, error Status_Lock_Not_Granted

Postby carlos vargas » Sat Jan 19, 2019 5:15 am

Puedes usar leto o o netio.
Usan protocolos de comunicación en lugar de file system
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1683
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua

Re: xbase ahora inestable, lenta, error Status_Lock_Not_Granted

Postby Antonio Linares » Sat Jan 19, 2019 8:42 am

Modificando muy poco se podría usar AdoRDD, pero creo que lo más simple es desactivar SMB2 y probar :-)

https://github.com/AHFERREIRA/adordd/blob/master/01_README.pdf
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: xbase ahora inestable, lenta, error Status_Lock_Not_Granted

Postby José » Sat Jan 19, 2019 3:32 pm

Antonio y Carlos, gracias por sus respuestas!

Creo que la opción de volver a SMB1 sería la que elija, porque soy algo (o bastante) ignorante en estos temas de configuraciones o servicios de Windows y similares y estoy contra el tiempo.

Pero me pregunto si Windows 10 en sus siguientes actualizaciones no quitará o ignorará la configuración que hagamos, o no eliminará SMB1 cuando quiera, dejando en ese caso a las estaciones de trabajo imposibilitadas de acceder a la ddbb xBase?

Existe alguna referencia al respecto? o alguna sugerencia adicional para ello?

Muchas gracias.

José
José Concha Leiva - Chile
"Querer, saber y hacer, es poder"
HB MSVSC + FWH 23.10 + MySQL/MaríaDB/DBFCDX (64 bits)
https://zenitx.com
User avatar
José
 
Posts: 38
Joined: Sat Dec 10, 2016 8:58 pm

Re: xbase ahora inestable, lenta, error Status_Lock_Not_Granted

Postby MOISES » Sun Jan 20, 2019 10:55 am

Por eso, bien utilizas ADS server (no sirve el modo local), o bien utilizas ADORDD, que mantiene la compatibilidad con la sintáxis actual.

Más allá de esto, y con la necesidad de reescribir el código, puedes utilizar las clases nativas de Fivewin de Mariadb/mysql.
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Re: xbase ahora inestable, lenta, error Status_Lock_Not_Granted

Postby José » Mon Jan 21, 2019 3:37 pm

Hola a todos. Gracias Moisés, analizaremos lo que indicas para ver si podemos hacerlo.

Hemos hecho el cambio a SMB1, y creo que la velocidad mejora algo y los errores parecen haberse reducido pero no eliminado.

Esta es una conversacion Samba entre una maquina 'pegada' (Windows, donde se queda pegado el software o luego de varios minutos suelta) y el servidor (Linux). 1 paquete de cada uno.

¿Habrá aquí algo que se pueda descubrir y ayude a mejorar el cambio hecho a SMB1?

Query del Cliente

Frame 641510: 129 bytes on wire (1032 bits), 129 bytes captured (1032 bits)
Ethernet II, Src: AsustekC_8d:a2:7b (34:97:f6:8d:a2:7b), Dst: HewlettP_b1:c0:64 (9c:b6:54:b1:c0:64)
Internet Protocol Version 4, Src: <IP>, Dst: <IP>
Transmission Control Protocol, Src Port: 50004, Dst Port: 445, Seq: 14081476, Ack: 7322407, Len: 75
Source Port: 50004
Destination Port: 445
[Stream index: 0]
[TCP Segment Len: 75]
Sequence number: 14081476 (relative sequence number)
[Next sequence number: 14081551 (relative sequence number)]
Acknowledgment number: 7322407 (relative ack number)
0101 .... = Header Length: 20 bytes (5)
Flags: 0x018 (PSH, ACK)
000. .... .... = Reserved: Not set
...0 .... .... = Nonce: Not set
.... 0... .... = Congestion Window Reduced (CWR): Not set
.... .0.. .... = ECN-Echo: Not set
.... ..0. .... = Urgent: Not set
.... ...1 .... = Acknowledgment: Set
.... .... 1... = Push: Set
.... .... .0.. = Reset: Not set
.... .... ..0. = Syn: Not set
.... .... ...0 = Fin: Not set
[TCP Flags: ·······AP···]
Window size value: 27609
[Calculated window size: 27609]
[Window size scaling factor: -1 (unknown)]
Checksum: 0x28ea [unverified]
[Checksum Status: Unverified]
Urgent pointer: 0
[SEQ/ACK analysis]
[This is an ACK to the segment in frame: 641509]
[The RTT to ACK the segment was: 0.000155000 seconds]
[Bytes in flight: 75]
[Bytes sent since last PSH flag: 75]
[Timestamps]
[Time since first frame in this TCP stream: 38.717737000 seconds]
[Time since previous frame in this TCP stream: 0.000155000 seconds]
TCP payload (75 bytes)
NetBIOS Session Service
Message Type: Session message (0x00)
Length: 71
SMB (Server Message Block Protocol)
SMB Header
Server Component: SMB
[Response in: 641511]
SMB Command: Locking AndX (0x24)
NT Status: STATUS_SUCCESS (0x00000000)
Flags: 0x18, Canonicalized Pathnames, Case Sensitivity
0... .... = Request/Response: Message is a request to the server
.0.. .... = Notify: Notify client only on open
..0. .... = Oplocks: OpLock not requested/granted
...1 .... = Canonicalized Pathnames: Pathnames are canonicalized
.... 1... = Case Sensitivity: Path names are caseless
.... ..0. = Receive Buffer Posted: Receive buffer has not been posted
.... ...0 = Lock and Read: Lock&Read, Write&Unlock are not supported
Flags2: 0xc807, Unicode Strings, Error Code Type, Extended Security Negotiation, Security Signatures, Extended Attributes, Long Names Allowed
1... .... .... .... = Unicode Strings: Strings are Unicode
.1.. .... .... .... = Error Code Type: Error codes are NT error codes
..0. .... .... .... = Execute-only Reads: Don't permit reads if execute-only
...0 .... .... .... = Dfs: Don't resolve pathnames with Dfs
.... 1... .... .... = Extended Security Negotiation: Extended security negotiation is supported
.... .0.. .... .... = Reparse Path: The request does not use a @GMT reparse path
.... .... .0.. .... = Long Names Used: Path names in request are not long file names
.... .... ...0 .... = Security Signatures Required: Security signatures are not required
.... .... .... 0... = Compressed: Compression is not requested
.... .... .... .1.. = Security Signatures: Security signatures are supported
.... .... .... ..1. = Extended Attributes: Extended attributes are supported
.... .... .... ...1 = Long Names Allowed: Long file names are allowed in the response
Process ID High: 0
Signature: 0000000000000000
Reserved: 0000
Tree ID: 10348
Process ID: 65279
User ID: 59639
Multiplex ID: 43073
Locking AndX Request (0x24)
Word Count (WCT): 8
AndXCommand: No further commands (0xff)
Reserved: 00
AndXOffset: 57054
FID: 0x7405
Lock Type: 0x10, Large Files
...1 .... = Large Files: Large file locking format requested
.... 0... = Cancel: Don't cancel outstanding lock request
.... .0.. = Change: Don't change lock type
.... ..0. = Oplock Break: This is not an oplock break notification/response
.... ...0 = Shared: This is an exclusive lock
Oplock Level: Client is not holding oplock on this file (0)
Timeout: Wait indefinitely (-1)
Number of Unlocks: 0
Number of Locks: 1
Byte Count (BCC): 20
Locks
Lock
Process ID: 65279
Reserved: 0000
Offset: 2147483646
Length: 1


Respuesta del Servidor

Transmission Control Protocol, Src Port: 445, Dst Port: 50004, Seq: 7322407, Ack: 14081551, Len: 39
Source Port: 445
Destination Port: 50004
[Stream index: 0]
[TCP Segment Len: 39]
Sequence number: 7322407 (relative sequence number)
[Next sequence number: 7322446 (relative sequence number)]
Acknowledgment number: 14081551 (relative ack number)
0101 .... = Header Length: 20 bytes (5)
Flags: 0x018 (PSH, ACK)
000. .... .... = Reserved: Not set
...0 .... .... = Nonce: Not set
.... 0... .... = Congestion Window Reduced (CWR): Not set
.... .0.. .... = ECN-Echo: Not set
.... ..0. .... = Urgent: Not set
.... ...1 .... = Acknowledgment: Set
.... .... 1... = Push: Set
.... .... .0.. = Reset: Not set
.... .... ..0. = Syn: Not set
.... .... ...0 = Fin: Not set
[TCP Flags: ·······AP···]
Window size value: 9713
[Calculated window size: 9713]
[Window size scaling factor: -1 (unknown)]
Checksum: 0x9733 [unverified]
[Checksum Status: Unverified]
Urgent pointer: 0
[SEQ/ACK analysis]
[This is an ACK to the segment in frame: 641510]
[The RTT to ACK the segment was: 0.000041000 seconds]
[Bytes in flight: 39]
[Bytes sent since last PSH flag: 39]
[Timestamps]
[Time since first frame in this TCP stream: 38.717778000 seconds]
[Time since previous frame in this TCP stream: 0.000041000 seconds]
TCP payload (39 bytes)
NetBIOS Session Service
Message Type: Session message (0x00)
Length: 35
SMB (Server Message Block Protocol)
SMB Header
Server Component: SMB
[Response to: 641510]
[Time from request: 0.000041000 seconds]
SMB Command: Locking AndX (0x24)
NT Status: STATUS_FILE_LOCK_CONFLICT (0xc0000054)
Flags: 0x88, Request/Response, Case Sensitivity
1... .... = Request/Response: Message is a response to the client/redirector
.0.. .... = Notify: Notify client only on open
..0. .... = Oplocks: OpLock not requested/granted
...0 .... = Canonicalized Pathnames: Pathnames are not canonicalized
.... 1... = Case Sensitivity: Path names are caseless
.... ..0. = Receive Buffer Posted: Receive buffer has not been posted
.... ...0 = Lock and Read: Lock&Read, Write&Unlock are not supported
Flags2: 0xc807, Unicode Strings, Error Code Type, Extended Security Negotiation, Security Signatures, Extended Attributes, Long Names Allowed
1... .... .... .... = Unicode Strings: Strings are Unicode
.1.. .... .... .... = Error Code Type: Error codes are NT error codes
..0. .... .... .... = Execute-only Reads: Don't permit reads if execute-only
...0 .... .... .... = Dfs: Don't resolve pathnames with Dfs
.... 1... .... .... = Extended Security Negotiation: Extended security negotiation is supported
.... .0.. .... .... = Reparse Path: The request does not use a @GMT reparse path
.... .... .0.. .... = Long Names Used: Path names in request are not long file names
.... .... ...0 .... = Security Signatures Required: Security signatures are not required
.... .... .... 0... = Compressed: Compression is not requested
.... .... .... .1.. = Security Signatures: Security signatures are supported
.... .... .... ..1. = Extended Attributes: Extended attributes are supported
.... .... .... ...1 = Long Names Allowed: Long file names are allowed in the response
Process ID High: 0
Signature: 0000000000000000
Reserved: 0000
Tree ID: 10348
Process ID: 65279
User ID: 59639
Multiplex ID: 43073
Locking AndX Response (0x24)
[Expert Info (Error/Malformed): Trying to fetch an unsigned integer with length 0]
[Trying to fetch an unsigned integer with length 0]
[Severity level: Error]
[Group: Malformed]
[Malformed Packet: SMB]
[Expert Info (Error/Malformed): Malformed Packet (Exception occurred)]
[Malformed Packet (Exception occurred)]
[Severity level: Error]
[Group: Malformed]

Gracias a todos por su paciencia y ayuda.

José, Chile
José Concha Leiva - Chile
"Querer, saber y hacer, es poder"
HB MSVSC + FWH 23.10 + MySQL/MaríaDB/DBFCDX (64 bits)
https://zenitx.com
User avatar
José
 
Posts: 38
Joined: Sat Dec 10, 2016 8:58 pm

Re: xbase ahora inestable, lenta, error Status_Lock_Not_Granted

Postby MOISES » Tue Jan 22, 2019 11:38 am

José:

Entonces vas a tener que usar ADORDD. Este tipo de errores creo que cuesta menos ajustar a ADORDD que incurrir en un buen número de horas de debug y testeo.

Un saludo
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Re: xbase ahora inestable, lenta, error Status_Lock_Not_Granted

Postby José » Tue Jan 22, 2019 4:13 pm

Moisés

Hola, te noto bastante convencido del uso de ADORDD y de que puede nesolver esta situación de la xBase.

¿lo usas?
¿tus bases de datos son grandes y con muchas tablas?
¿con más de 50 usuarios simultáneos?
¿qué tantos cambios reales al código fuente requiere?

(Si gustas puedes comunicarte conmigo y lo vemos. Te agradezco).

Amigos, y como solución temporal ¿dividir la empresa en grupos, y poner a los usuarios en equipos con Windows Server (tenemos 2012) con la ddbb xBase en el mismo equipo ¿ya no requeriría del servicio SMB? ¿y si fuera así, es una opción, alguien ha hecho eso?. En mi caso yo siempre he intentado controlar bien los bloqueos y desbloqueos de registros y la grabación en el software, por si es relevante para esto.

Muchas gracias a todos.

José, Chile
José Concha Leiva - Chile
"Querer, saber y hacer, es poder"
HB MSVSC + FWH 23.10 + MySQL/MaríaDB/DBFCDX (64 bits)
https://zenitx.com
User avatar
José
 
Posts: 38
Joined: Sat Dec 10, 2016 8:58 pm

Re: xbase ahora inestable, lenta, error Status_Lock_Not_Granted

Postby José » Tue Jan 22, 2019 4:21 pm

Amigos, hola

Una pregunta más ¿volver a SMB1 a alguien en verdad le ha funcionado? porque nosotros (con estaciones de trabajo Windows 7 y 10 y con servidor Linux Debian 9) hemos notado algo de mejora pero no hemos podido resolverlo realmente.

José, Chile
José Concha Leiva - Chile
"Querer, saber y hacer, es poder"
HB MSVSC + FWH 23.10 + MySQL/MaríaDB/DBFCDX (64 bits)
https://zenitx.com
User avatar
José
 
Posts: 38
Joined: Sat Dec 10, 2016 8:58 pm

Re: xbase ahora inestable, lenta, error Status_Lock_Not_Granted

Postby MOISES » Tue Jan 22, 2019 9:07 pm

Hola:

Nosotros migramos a MySQL porque en su momento ADORDD no estaba. Después lo probé y me gustó mucho. Las DBFS no funcionan bien en LAN.
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Re: xbase ahora inestable, lenta, error Status_Lock_Not_Granted

Postby Rick Lipkin » Tue Jan 22, 2019 10:08 pm

José

As Moses comments .. there are potential opt lock problems with .dbf and certain networks ... I moved away from .dbf over 10 years ago to ADO and Sql rdms's .. YES, I had to re-write my programs to deal with SQL query syntax and never looked back and I have NO problems with performance ..

To make the leap to ADO easier Rao has created a series of ADO wrappers that make manipulating Sql management very easy and simple ..

Use Ms Access .mdb for local or portable apps or any RDMS like Sql Server with very little changes from one back-end to another.

check out \source\function\adofuncs.prg

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2616
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: xbase ahora inestable, lenta, error Status_Lock_Not_Granted

Postby José » Wed Jan 23, 2019 12:28 am

Moisés y Rick

Muchas gracias, y a todos, por su interés y ayuda y por compartir su experiencia en esto.

Ya no molestaré más con este tema, no hay más que hacer con las DBF.... hay que cambiarse... sea ADORDD, MySQL puro u otra solución... a trabajar en ello de día y de noche... así que molestaré con MySQL...

Agradecidos saludos desde Chile.

José
José Concha Leiva - Chile
"Querer, saber y hacer, es poder"
HB MSVSC + FWH 23.10 + MySQL/MaríaDB/DBFCDX (64 bits)
https://zenitx.com
User avatar
José
 
Posts: 38
Joined: Sat Dec 10, 2016 8:58 pm

Re: xbase ahora inestable, lenta, error Status_Lock_Not_Granted

Postby Carlos Mora » Thu Jan 24, 2019 10:32 am

Hola José,

En las estaciones prueba de modificar las siguientes entradas para desabilitar SMB2, que suele ser el origen del problema:

Hilo del foro con varias explicaciones:
viewtopic.php?f=6&t=7682&start=30&hilit=samba

HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/LanmanServer/Parameters
EnableOpLocks = 0 (hex)
EnableOpLockForceClose = 1 (hex)
CachedOpenLimit = 0 (hex)

Eso es clave para evitar problemas de concurrencia. En el samba tienes que tener los OPLOCKS disabled
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Carlos Mora
 
Posts: 988
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Next

Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 80 guests